#14357: Prevent innapropriate order-based grouping on values+annotate queries -------------------------------------+------------------------------------- Reporter: Martin Chase | Owner: (none) Type: Bug | Status: new Component: Database layer | Version: (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Simon Charette): I think we could and should make this change as it really common pitfall but it should follow a deprecation path. I've personally stopped using `ordering` because of its unexpected interaction with `distinct()` and `values()` for grouping by. The deprecation path should detect when `values()` is used for grouping on a queryset where the only defined ordering is from `_meta.ordering` in the SQL compiling step and raise a deprecation warning saying such ordering will be ignored in future version of Django. -- Ticket URL: <https://code.djangoproject.com/ticket/14357#comment:10> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.61b879c625ed4bd9eedca0629c1ebc8a%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.