#10666: Aggregate with inherited columns does not work as expected
-----------------------------+----------------------------------------------
 Reporter:  julianb          |       Owner:            
   Status:  new              |   Milestone:  1.1 beta  
Component:  ORM aggregation  |     Version:  SVN       
 Keywords:                   |       Stage:  Unreviewed
Has_patch:  0                |  
-----------------------------+----------------------------------------------
 {{{
 class Thing(models.Model):
     user = models.ForeignKey("auth.user")
     creation_date = models.DateTimeField(_('Creation date'),
 default=datetime.datetime.now)
     amount = models.PositiveIntegerField()

 class Book(Thing):
     blabla = models.ForeignKey("xyz")

 # does not work
 Book.objects.filter(user=request.user).aggregate(Sum('amount'))
 # does work
 Book.objects.filter(user=request.user).annotate(Sum('amount'))
 # does work
 Book.objects.filter(user=request.user).aggregate(Sum('book_ptr__amount'))
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10666>
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