Skip to content

Commit

Permalink
Fixed #8283 -- Fixed an edge case when adding things to the "where" t…
Browse files Browse the repository at this point in the history
…ree and

combining different connector types.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Aug 16, 2008
1 parent 4dece4f commit c127f01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion django/utils/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def add(self, node, conn_type):
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
Expand Down
6 changes: 6 additions & 0 deletions tests/regressiontests/queries/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,12 @@ class Join(models.Model):
>>> 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
Expand Down

0 comments on commit c127f01

Please sign in to comment.