#10060: Multiple table annotation failure
-------------------------------------+-------------------------------------
     Reporter:  svsharma@…           |                    Owner:
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by camillobruni):

 I recently ran into a similar problem. The deep joining causes an
 explosion of values possibly resulting in many duplicate values. I fixed
 this in https://github.com/django/django/pull/4388 by implementing the
 DISTINCT parameter on the Aggregate functions. Hence you can do
 {{{Sum('center__client__loan__payment_schedule__payments__principal',
 distinct=True)}}}
 which ignores the duplicate entries.

 It might be that the issue at hand is slightly different, but this solves
 at least one particular case.

--
Ticket URL: <https://code.djangoproject.com/ticket/10060#comment:50>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/081.8f748e31a9d8935da37b5263c8a2754b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to