summaryrefslogtreecommitdiff
path: root/django/utils/tree.py
diff options
context:
space:
mode:
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