using locals() in search-results.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sat, 10 Jan 2009 19:39:35 +0000 (19:39 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sat, 10 Jan 2009 19:39:35 +0000 (19:39 +0000)
This works because locals is a dict, and .render expects keyword args,
and you can supply a dict as a keyword set using the **dict syntax.

git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@97 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/syrup/views.py

index b273404..9eb71f3 100644 (file)
@@ -239,18 +239,5 @@ def search(request):
             print term
     '''
 
-    #not sure this would be the best way but locals() would be cleaner
-    #can this be done with genshi?
-    '''
-    return g.render('search_results.xhtml', locals())
-    '''
-    return g.render('search_results.xhtml', paginator=paginator,
-                    page_num=page_num,
-                    count=count, query_string=query_string, 
-                    course_list=course_list,
-                    instructor_list=instructor_list,
-                    norm_query=norm_query, 
-                    results_len=results_len,
-                    course_len=course_len,
-                    instr_len=instr_len)
+    return g.render('search_results.xhtml', **locals())