Skip to content

Commit

Permalink
readme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
denz committed May 4, 2012
1 parent f7f51c5 commit 3058d74
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,23 @@ views.py::
#ALERT: NEVER PASS USER INPUT AS EVALUATED VARIABLES
#use literals for that

if request.REQUEST.get('search', None): #bonus: previus search stored too
if request.REQUEST.get('search', None): #bonus: previous search stored too
actual_query.literals(search=request.REQUEST['search'])


if request.REQUEST.get('min_rating', None): #override min_rating if required
actual_query.literals(min_related_rating=int(request.REQUEST['min_rating']))
actual_query.literals(min_related_rating=request.REQUEST['min_rating'])

#now we can store it together with last search string and `min_related_rating` parameter
store_search(actual_query)
#NOTICE. `related` and any evaluated variables will NOT be stored
#so next time we have to call query with `related` again.

return render_to_response('search.html', {'items':actual_query.objects})
return render_to_response('search.html', {'items':actual_query.objects})

INSTALLATION
============
Try one of these::

pip install django-stored-queryset
easy_install django-stored-queryset

0 comments on commit 3058d74

Please sign in to comment.