Author: mtredinnick
Date: 2007-10-13 21:15:03 -0500 (Sat, 13 Oct 2007)
New Revision: 6493

Modified:
   django/branches/queryset-refactor/django/utils/tree.py
Log:
queryset-refactor: Fixed a bug in Node.negate() for already negated nodes.


Modified: django/branches/queryset-refactor/django/utils/tree.py
===================================================================
--- django/branches/queryset-refactor/django/utils/tree.py      2007-10-14 
02:14:53 UTC (rev 6492)
+++ django/branches/queryset-refactor/django/utils/tree.py      2007-10-14 
02:15:03 UTC (rev 6493)
@@ -80,7 +80,8 @@
         Interpreting the meaning of this negate is up to client code. This
         method is useful for implementing "not" arrangements.
         """
-        self.children = [NegatedNode(self.children, self.connection)]
+        self.children = [NegatedNode(self.children, self.connection,
+                old_state=self.negated)]
         self.connection = self.default
 
     def start_subtree(self, conn_type):
@@ -117,7 +118,7 @@
     A class that indicates the connection type should be negated (whatever that
     means -- it's up to the client) when used by the client code.
     """
-    def __init__(self, children=None, connection=None):
+    def __init__(self, children=None, connection=None, old_state=True):
         super(NegatedNode, self).__init__(children, connection)
-        self.negated = True
+        self.negated = not old_state
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to