[open-ils-commits] r80 - servres/trunk/conifer/syrup
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 16 14:01:43 EST 2008
Author: artunit
Date: 2008-12-16 14:01:40 -0500 (Tue, 16 Dec 2008)
New Revision: 80
Modified:
servres/trunk/conifer/syrup/views.py
Log:
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2008-12-16 18:19:41 UTC (rev 79)
+++ servres/trunk/conifer/syrup/views.py 2008-12-16 19:01:40 UTC (rev 80)
@@ -167,19 +167,26 @@
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)
More information about the open-ils-commits
mailing list