#6603: QuerySet in extra_context should be handled automatically
---------------------------------------------+------------------------------
          Reporter:  Waldemar Kornewald      |         Owner:  nobody
            Status:  new                     |     Milestone:        
         Component:  Generic views           |       Version:  SVN   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  1     
        Needs_docs:  1                       |   Needs_tests:  1     
Needs_better_patch:  1                       |  
---------------------------------------------+------------------------------
Comment (by bitprophet):

 SmileyChris -- that works if you want a top level manager result such as
 `.all()` (since you can grab the callable itself), but doesn't work if you
 want to do any sort of actual filtering, such as (totally arbitrary
 example):
 {{{
 extra_context = {'top_news': News.objects.filter(rating__gte=5)}
 }}}

 It's been a while since I looked at this issue but IIRC the deal is that
 the 'callable or not callable' test is too naive because QuerySets aren't
 callable (last I checked) and so the existing code does ''not'' re-
 evaluate them, despite QSs having the capacity to be re-evaluated via
 `._clone()`.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6603#comment:6>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to