Ticket #16979: df1.diff
File df1.diff, 1.7 KB (added by , 13 years ago) |
---|
-
tree.py
old new 45 45 return obj 46 46 _new_instance = classmethod(_new_instance) 47 47 48 @staticmethod 49 def _push (t, pfx): 50 """adds pfx to the first member of any tuple in the tree.""" 51 import copy 52 if isinstance(t, tuple): 53 return ((pfx+t[0],)+t[1:]) 54 55 elif isinstance(t, list): 56 return map(lambda x: Node._push(x, pfx), t) 57 58 elif isinstance (t, Node): 59 t2 = copy.copy(t) 60 t2.children = Node._push(t2.children, pfx) 61 t2.subtree_parents = Node._push(t2.subtree_parents, pfx) 62 return t2 63 64 else: 65 return copy.copy(t) 66 48 67 def __str__(self): 49 68 if self.negated: 50 69 return '(NOT (%s: %s))' % (self.connector, ', '.join([str(c) for c -
query.py
old new 1167 1167 self.where.start_subtree(connector) 1168 1168 if isinstance(child, Node): 1169 1169 self.add_q(child, used_aliases, force_having=force_having) 1170 elif isinstance(child, tuple) and isinstance(child[1], Node): 1171 self.add_q(_push(child[1], child_[0]+'__'), 1172 used_aliases, force_having=force_having) 1170 1173 else: 1171 1174 self.add_filter(child, connector, q_object.negated, 1172 1175 can_reuse=used_aliases, force_having=force_having)