[Django] #28629: Q objects are no longer hashable in 2.0.

4 views
Skip to first unread message

Django

unread,
Sep 23, 2017, 2:06:50 PM9/23/17
to django-...@googlegroups.com
#28629: Q objects are no longer hashable in 2.0.
-------------------------------------+-------------------------------------
Reporter: coady | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.0
layer (models, ORM) |
Severity: Normal | Keywords: Q hash
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
`tree.node` acquired an `__eq__` method, but not `__hash__`, making it an
unhashable type. This affects subclasses such as `Q`.

My use case was having a mapping of `Q` objects to values.

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

Django

unread,
Sep 24, 2017, 5:28:46 AM9/24/17
to django-...@googlegroups.com
#28629: Q objects are no longer hashable in 2.0.
-------------------------------------+-------------------------------------
Reporter: coady | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Q hash | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

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

* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


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

Django

unread,
Sep 24, 2017, 9:51:26 AM9/24/17
to django-...@googlegroups.com
#28629: Q objects are no longer hashable in 2.0.
-------------------------------------+-------------------------------------
Reporter: coady | Owner: felixxm
Type: Bug | Status: assigned

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Q hash | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

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

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


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

Django

unread,
Sep 24, 2017, 10:59:54 AM9/24/17
to django-...@googlegroups.com
#28629: Q objects are no longer hashable in 2.0.
-------------------------------------+-------------------------------------
Reporter: coady | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Q hash | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Sep 28, 2017, 12:07:35 PM9/28/17
to django-...@googlegroups.com
#28629: Q objects are no longer hashable in 2.0.
-------------------------------------+-------------------------------------
Reporter: coady | Owner: felixxm
Type: Bug | Status: closed

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: Q hash | Triage Stage: Accepted
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: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fc6528b25ab1834be1a478b405bf8f7ec5cf860c" fc6528b]:
{{{
#!CommitTicketReference repository=""
revision="fc6528b25ab1834be1a478b405bf8f7ec5cf860c"
Fixed #28629 -- Made tree.Node instances hashable.

Regression in 508b5debfb16843a8443ebac82c1fb91f15da687 which
added Node.__eq__().
}}}

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

Django

unread,
Sep 28, 2017, 12:13:21 PM9/28/17
to django-...@googlegroups.com
#28629: Q objects are no longer hashable in 2.0.
-------------------------------------+-------------------------------------
Reporter: coady | Owner: felixxm
Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: Q hash | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"8368d5a4006d84abacbcf53b9688a8f84ccf6f0c" 8368d5a4]:
{{{
#!CommitTicketReference repository=""
revision="8368d5a4006d84abacbcf53b9688a8f84ccf6f0c"
[2.0.x] Fixed #28629 -- Made tree.Node instances hashable.

Regression in 508b5debfb16843a8443ebac82c1fb91f15da687 which
added Node.__eq__().

Backport of fc6528b25ab1834be1a478b405bf8f7ec5cf860c from master
}}}

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

Reply all
Reply to author
Forward
0 new messages