Loading django/utils/tree.py +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ class Node(object): Otherwise, the whole tree is pushed down one level and a new root connector is created, connecting the existing tree and the new node. """ if node in self.children: if node in self.children and conn_type == self.connector: return if len(self.children) < 2: self.connector = conn_type Loading tests/regressiontests/queries/models.py +6 −0 Original line number Diff line number Diff line Loading @@ -891,6 +891,12 @@ True >>> Celebrity.objects.count() == num_celebs True Bug #8283 -- Checking that applying filters after a disjunction works correctly. >>> (ExtraInfo.objects.filter(note=n1)|ExtraInfo.objects.filter(info='e2')).filter(note=n1) [<ExtraInfo: e1>] >>> (ExtraInfo.objects.filter(info='e2')|ExtraInfo.objects.filter(note=n1)).filter(note=n1) [<ExtraInfo: e1>] """} # In Python 2.3, exceptions raised in __len__ are swallowed (Python issue Loading Loading
django/utils/tree.py +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ class Node(object): Otherwise, the whole tree is pushed down one level and a new root connector is created, connecting the existing tree and the new node. """ if node in self.children: if node in self.children and conn_type == self.connector: return if len(self.children) < 2: self.connector = conn_type Loading
tests/regressiontests/queries/models.py +6 −0 Original line number Diff line number Diff line Loading @@ -891,6 +891,12 @@ True >>> Celebrity.objects.count() == num_celebs True Bug #8283 -- Checking that applying filters after a disjunction works correctly. >>> (ExtraInfo.objects.filter(note=n1)|ExtraInfo.objects.filter(info='e2')).filter(note=n1) [<ExtraInfo: e1>] >>> (ExtraInfo.objects.filter(info='e2')|ExtraInfo.objects.filter(note=n1)).filter(note=n1) [<ExtraInfo: e1>] """} # In Python 2.3, exceptions raised in __len__ are swallowed (Python issue Loading