From: artunit Date: Fri, 28 Nov 2008 03:19:15 +0000 (+0000) Subject: git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@64 6d9bc8c9-1ec2-4278... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e6bfd12a3274f85a1b0151d5ca08e9099793d13d;p=syrup%2Fmasslnc.git git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@64 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index a9f72b6..bf17fdb 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -145,15 +145,15 @@ def search(request): ''' query_string = '' found_entries = None + page_num = int(request.GET.get('page', 1)) + count = int(request.GET.get('count', 5)) if ('q' in request.GET) and request.GET['q'].strip(): query_string = request.GET['q'] - - entry_query = get_query(query_string, ['code', 'name',]) - - #found_entries = Entry.objects.filter(entry_query).order_by('-pub_date') - found_entries = models.Term.objects.filter(entry_query).order_by('-pub_date') + entry_query = get_query(query_string, ['title', 'enrol_codes',]) + paginator = Paginator( models.Course.objects.filter(entry_query).order_by('-title'), + count) - return render_to_response('search/search_results.html', - { 'query_string': query_string, 'found_entries': found_entries }, - context_instance=RequestContext(request)) + return g.render('search_results.xhtml', paginator=paginator, + page_num=page_num, + count=count, query_string=query_string)