git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@66 6d9bc8c9-1ec2-4278...
authorartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 28 Nov 2008 21:13:01 +0000 (21:13 +0000)
committerartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 28 Nov 2008 21:13:01 +0000 (21:13 +0000)
conifer/syrup/views.py

index 078b94a..bb71e98 100644 (file)
@@ -149,11 +149,13 @@ def search(request):
     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, ['title', 'author', 'course__title', 'course__department__name',])
-        paginator = Paginator( models.Item.objects.filter(entry_query).order_by('-date_created'),
+        entry_query = get_query(query_string, ['title', 'author', 'course__title', 'course__department__name'])
+        instr_query = get_query(query_string, ['user__last_name'])
+        paginator = Paginator( models.Item.objects.filter(entry_query).order_by('-date_created'), 
             count)
+        instructor_list = models.Member.objects.filter(instr_query).filter(role='INSTR').order_by('-user__last_name')
 
     return g.render('search_results.xhtml', paginator=paginator,
                     page_num=page_num,
-                    count=count, query_string=query_string)
+                    count=count, query_string=query_string, instructor_list=instructor_list)