[Django] #24923: Aggregates in order_by should error out nicely

15 views
Skip to first unread message

Django

unread,
Jun 4, 2015, 10:49:26 AM6/4/15
to django-...@googlegroups.com
#24923: Aggregates in order_by should error out nicely
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 1.8
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Expressions are allowed in order_by, but aggregates don't currently work.
Making them work would cause too much trouble when taking in account that
you can already do
{{{
qs.annotate(agg=Sum('foo')).order_by('agg')
}}}
as opposed to
{{{
qs.order_by(Sum('foo'))
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24923>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 4, 2015, 11:19:28 AM6/4/15
to django-...@googlegroups.com
#24923: Aggregates in order_by should error out nicely
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: zedr
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 1.8
(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
-------------------------------------+-------------------------------------
Changes (by zedr):

* owner: nobody => zedr
* status: new => assigned


Comment:

akaariai: what would you suggest as the error message or behaviour?

--
Ticket URL: <https://code.djangoproject.com/ticket/24923#comment:1>

Django

unread,
Jun 4, 2015, 11:23:08 AM6/4/15
to django-...@googlegroups.com
#24923: Aggregates in order_by should error out nicely
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner:
Type: | Status: new
Cleanup/optimization |

Component: Database layer | Version: 1.8
(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
-------------------------------------+-------------------------------------
Changes (by zedr):

* owner: zedr =>
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/24923#comment:2>

Django

unread,
Jun 4, 2015, 12:19:53 PM6/4/15
to django-...@googlegroups.com
#24923: Aggregates in order_by should error out nicely
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner:
Type: | Status: new
Cleanup/optimization |
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: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* needs_better_patch: 0 => 1
* version: 1.8 => master


Comment:

Left notes on the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/24923#comment:3>

Django

unread,
Jun 28, 2015, 4:39:48 AM6/28/15
to django-...@googlegroups.com
#24923: Aggregates in order_by should error out nicely
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner:
Type: | Status: new
Cleanup/optimization |

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by akaariai):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


Comment:

I've fixed all review issues.

--
Ticket URL: <https://code.djangoproject.com/ticket/24923#comment:4>

Django

unread,
Jul 13, 2015, 8:37:47 AM7/13/15
to django-...@googlegroups.com
#24923: Aggregates in order_by should error out nicely
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: Tim
Type: | Graham <timograham@…>
Cleanup/optimization | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* owner: => Tim Graham <timograham@…>
* resolution: => fixed


Comment:

In [changeset:"6f403056f09b0a77df9791125591f3057e328ab7" 6f40305]:
{{{
#!CommitTicketReference repository=""
revision="6f403056f09b0a77df9791125591f3057e328ab7"
Fixed #24923 -- errored out nicely when using aggregates in order_by()
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24923#comment:5>

Reply all
Reply to author
Forward
0 new messages