summaryrefslogtreecommitdiff
path: root/django/utils/tree.py
diff options
context:
space:
mode:
authorIan Foote <python@ian.feete.org>2016-11-06 10:37:07 +0000
committerTim Graham <timograham@gmail.com>2017-02-23 20:47:48 -0500
commit508b5debfb16843a8443ebac82c1fb91f15da687 (patch)
tree1281cdc5b664d118bf709686c49fc3ceae42dd4c /django/utils/tree.py
parent19b2dfd1bfe7fd716dd3d8bfa5f972070d83b42f (diff)
downloaddjango-508b5debfb16843a8443ebac82c1fb91f15da687.tar.gz
Refs #11964 -- Made Q objects deconstructible.
Diffstat (limited to 'django/utils/tree.py')
-rw-r--r--django/utils/tree.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/tree.py b/django/utils/tree.py
index 15f3c58205..74612736f1 100644
--- a/django/utils/tree.py
+++ b/django/utils/tree.py
@@ -63,6 +63,13 @@ class Node:
"""Return True if 'other' is a direct child of this instance."""
return other in self.children
+ def __eq__(self, other):
+ if self.__class__ != other.__class__:
+ return False
+ if (self.connector, self.negated) == (other.connector, other.negated):
+ return self.children == other.children
+ return False
+
def add(self, data, conn_type, squash=True):
"""
Combine this tree and the data represented by data using the