#10182: "invalid reference to FROM-clause" for nested annotate query
---------------------------------------------------+------------------------
          Reporter:  omat                          |         Owner:  nobody     
           
            Status:  new                           |     Milestone:             
           
         Component:  Database layer (models, ORM)  |       Version:  SVN        
           
        Resolution:                                |      Keywords:  nested 
query, annotate
             Stage:  Unreviewed                    |     Has_patch:  0          
           
        Needs_docs:  0                             |   Needs_tests:  0          
           
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by omat):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 BTW: If I force the first query to be evaluated before it is used as a
 nested query, using the python step syntax or using list() for example,
 like:

 {{{
 >>> tag_ids =
 TaggedItem.objects.all().order_by('-added__max').values_list('id',
 flat=True).annotate(Max('added'))[:10:1]
 }}}

 Then the second runs fine.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10182#comment:1>
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