Commits

Anonymous committed 9e65be7

Fixed documentation bug.

Comments (0)

Files changed (2)

django-hack-a-thon-get-handson.pdf

Binary file modified.

django-hack-a-thon-get-handson.txt

     from polls.models import Poll
 
     def index(request):
-        latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
+        latest_poll_list = Poll.all().order('-pub_date').fetch(5)
         output = ', '.join([p.question for p in latest_poll_list])
         return HttpResponse(output)