mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #16211 -- Added comparison and negation ops to F() expressions
Work done by Walter Doekes and Trac alias knoeb. Reviewed by Simon Charette.
This commit is contained in:
@@ -88,8 +88,12 @@ 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 and conn_type == self.connector:
|
||||
return
|
||||
# Using for loop with 'is' instead of 'if node in children' so node
|
||||
# __eq__ method doesn't get called. The __eq__ method can be overriden
|
||||
# by subtypes, for example the F-expression.
|
||||
for child in self.children:
|
||||
if node is child and conn_type == self.connector:
|
||||
return
|
||||
if len(self.children) < 2:
|
||||
self.connector = conn_type
|
||||
if self.connector == conn_type:
|
||||
|
||||
Reference in New Issue
Block a user