From 07f4eeb10facd5885e17a624482020bb5e387187 Mon Sep 17 00:00:00 2001 From: artunit Date: Tue, 16 Dec 2008 19:01:40 +0000 Subject: [PATCH] git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@80 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/syrup/views.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index 608fe75..a35ed34 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -167,19 +167,26 @@ def search(request): count) #course search course_query = get_query(query_string, ['title', 'department__name']) - course_list = models.Course.objects.filter(course_query).order_by('-title')[0:5] + course_list = models.Course.objects.filter(course_query).order_by('title')[0:5] + course_len = len(models.Course.objects.filter(course_query)) #instructor search instr_query = get_query(query_string, ['user__last_name']) - instructor_list = models.Member.objects.filter(instr_query).filter(role='INSTR').order_by('-user__last_name')[0:5] + print get_query(query_string, ['user__last_name']) + instructor_list = models.Member.objects.filter(instr_query).filter(role='INSTR').order_by('user__last_name')[0:5] + print instructor_list print(norm_query) for term in norm_query: print term - print len(models.Member.objects.filter(instr_query).filter(role='INSTR')) + #len(instructor_list) -- will reflect limit + #there might be a better way of doing this, though this table should not be expensive to query instr_len = len(models.Member.objects.filter(instr_query).filter(role='INSTR')) - #print highlight('The River Is Wide', 'is wide') return g.render('search_results.xhtml', paginator=paginator, page_num=page_num, - count=count, query_string=query_string, instructor_list=instructor_list, - norm_query=norm_query, instr_len=instr_len) + count=count, query_string=query_string, + course_list=course_list, + instructor_list=instructor_list, + norm_query=norm_query, + course_len=course_len, + instr_len=instr_len) -- 2.11.0