#30047: Documentation: add a Note about default ordering on models used in Subquery filters -------------------------------------+------------------------------------- Reporter: powderflask | Owner: nobody Type: | Status: closed Cleanup/optimization | Component: Documentation | Version: 2.1 Severity: Normal | Resolution: | worksforme Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Marten Kenbeek): Replying to [comment:6 Simon Charette]: > It does when annotated aggregation functions are involved and can be quite a surprise when `Meta.ordering` is involved, see #14357. Any column in `SELECT` or `ORDER BY` must be present in `GROUP BY`, but it's not necessary to add columns from `ORDER BY` to the `SELECT` clause, and as far as I can tell Django does not add the extra columns to `SELECT`. I suspect powderflask has something (e.g. an annotation) that adds an extra column to the subquery, that's not caused by any ordering. At this point we'd have to see the original code/query to be sure. -- Ticket URL: <https://code.djangoproject.com/ticket/30047#comment:8> 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/069.3a34fcf2c8829213ae8b1f98b4aa88a7%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.