#28107: Can't perform annotation on related table when relation between tables
not
on primary key
-------------------------------------+-------------------------------------
Reporter: powderflask | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: QuerySet.extra | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by powderflask):
It occurs to me that if there were some way to force values into the
group-by clause, that would serve as a reasonable workaround, given this
is bound to be a fairly rare use-case.
I did read some hacks that did this in 1.8, but it looks like
query.group_by is now a boolean rather than a list of fields... was
pretty ugly anyhow.
But I'm not missing something more obvious here am I -- like an extra()
clause or something that could force the offending aggregate fields into
the group_by clause?
--
Ticket URL: <https://code.djangoproject.com/ticket/28107#comment:7>
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/069.c20d826ec8974a4422fbdf1a5bc74f55%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.