[Django] #24268: Remove Query.having

13 views
Skip to first unread message

Django

unread,
Feb 3, 2015, 5:57:53 AM2/3/15
to django-...@googlegroups.com
#24268: Remove Query.having
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Instead of Query.having and Query.where we could instead use Query.where
only, and then split that to where and having parts in the compiler.

The main reason for doing the split in compiler is that we gain a bit
simpler Query class without any significant complications to the where
class.

There are other cases, too, where such a split would be needed. For
example, window aggregates can't be filtered on the same query level. So,
`qs.filter(row_num__lte=10)` would need to be splitted into an outer
query's where clause.

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

Django

unread,
Feb 3, 2015, 12:49:24 PM2/3/15
to django-...@googlegroups.com
#24268: Remove Query.having
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(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
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/3779 PR]

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

Django

unread,
Feb 4, 2015, 7:46:00 AM2/4/15
to django-...@googlegroups.com
#24268: Remove Query.having
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

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


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

Django

unread,
Feb 4, 2015, 9:30:26 AM2/4/15
to django-...@googlegroups.com
#24268: Remove Query.having
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: closed

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

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"afe0bb7b13bb8dc4370f32225238012c873b0ee3"]:
{{{
#!CommitTicketReference repository=""
revision="afe0bb7b13bb8dc4370f32225238012c873b0ee3"
Fixed #24268 -- removed Query.having

Instead of splitting filter clauses to where and having parts before
adding them to query.where or query.having, add all filter clauses to
query.where, and when compiling the query split the where to having and
where parts.
}}}

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

Reply all
Reply to author
Forward
0 new messages