diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2017-09-28 18:07:19 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-09-28 12:07:19 -0400 |
commit | fc6528b25ab1834be1a478b405bf8f7ec5cf860c (patch) | |
tree | fbdf00056ceaa9017967a79276d5c2d95720a616 /django/utils/tree.py | |
parent | 44f08422c872e32854216b2b30aab119ec3bb5d8 (diff) | |
download | django-fc6528b25ab1834be1a478b405bf8f7ec5cf860c.tar.gz |
Fixed #28629 -- Made tree.Node instances hashable.
Regression in 508b5debfb16843a8443ebac82c1fb91f15da687 which
added Node.__eq__().
Diffstat (limited to 'django/utils/tree.py')
-rw-r--r-- | django/utils/tree.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/utils/tree.py b/django/utils/tree.py index 392838b482..b7f7b9798b 100644 --- a/django/utils/tree.py +++ b/django/utils/tree.py @@ -70,6 +70,9 @@ class Node: self.children == other.children ) + def __hash__(self): + return hash((self.__class__, self.connector, self.negated) + tuple(self.children)) + def add(self, data, conn_type, squash=True): """ Combine this tree and the data represented by data using the |