#30771: Filtering on query result overrides GROUP BY of internal query
-------------------------------------+-------------------------------------
Reporter: Aur Saraf | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: annotate, | Triage Stage:
annotation, filter, groupby, | Unreviewed
aggregate, aggregation |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Aur Saraf):
Workaround:
{{{
from django.contrib.auth import models
a =
models.User.objects.filter(email__isnull=True).values('email').aggregate(Max('id'))['id_max']
b = models.User.objects.filter(id=a)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30771#comment:1>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.1bd67e2ae2dadbece619158ab6f067e2%40djangoproject.com.