diff -ur venv/lib/python2.6/site-packages/django/db/models/query_utils.py django_off/db/models/query_utils.py
old
|
new
|
|
43 | 43 | default = AND |
44 | 44 | |
45 | 45 | def __init__(self, *args, **kwargs): |
46 | | children = list(args) |
47 | | for k,v in kwargs.items(): |
48 | | if isinstance(v, tree.Node): |
49 | | children.append(v._prefix(k+'__')) |
50 | | else: |
51 | | children.append((k,v)) |
52 | | super(Q, self).__init__(children=children) |
| 46 | super(Q, self).__init__(children=list(args) + kwargs.items()) |
53 | 47 | |
54 | 48 | def _combine(self, other, conn): |
55 | 49 | if not isinstance(other, Q): |
Binary files venv/lib/python2.6/site-packages/django/db/models/query_utils.pyc and django_off/db/models/query_utils.pyc differ
Binary files venv/lib/python2.6/site-packages/django/db/models/sql/query.pyc and django_off/db/models/sql/query.pyc differ
diff -ur venv/lib/python2.6/site-packages/django/utils/tree.py django_off/utils/tree.py
old
|
new
|
|
5 | 5 | |
6 | 6 | from django.utils.copycompat import deepcopy |
7 | 7 | |
8 | | |
9 | | def _t_prefix (t, pfx): |
10 | | """adds pfx to the first member of any tuple in the tree.""" |
11 | | import copy |
12 | | |
13 | | if isinstance(t, tuple): |
14 | | return ((pfx+t[0],)+t[1:]) |
15 | | |
16 | | elif isinstance(t, list): |
17 | | return map(lambda x: _t_prefix(x, pfx), t) |
18 | | |
19 | | elif isinstance (t, Node): |
20 | | t2 = copy.copy(t) |
21 | | t2.children = _t_prefix(t2.children, pfx) |
22 | | t2.subtree_parents = _t_prefix(t2.subtree_parents, pfx) |
23 | | return t2 |
24 | | |
25 | | |
26 | 8 | class Node(object): |
27 | 9 | """ |
28 | 10 | A single internal node in the tree graph. A Node should be viewed as a |
… |
… |
|
63 | 45 | return obj |
64 | 46 | _new_instance = classmethod(_new_instance) |
65 | 47 | |
66 | | def _prefix(self, pfx): |
67 | | return _t_prefix(self, pfx) |
68 | | |
69 | 48 | def __str__(self): |
70 | 49 | if self.negated: |
71 | 50 | return '(NOT (%s: %s))' % (self.connector, ', '.join([str(c) for c |