summaryrefslogtreecommitdiff
path: root/django/db/models/sql/where.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/where.py')
-rw-r--r--django/db/models/sql/where.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py
index 4aa2351f17..cf147c6ad9 100644
--- a/django/db/models/sql/where.py
+++ b/django/db/models/sql/where.py
@@ -220,7 +220,7 @@ class WhereNode(tree.Node):
child.relabel_aliases(change_map)
elif isinstance(child, tree.Node):
self.relabel_aliases(change_map, child)
- else:
+ elif isinstance(child, (list, tuple)):
if isinstance(child[0], (list, tuple)):
elt = list(child[0])
if elt[0] in change_map:
@@ -254,6 +254,14 @@ class NothingNode(object):
def relabel_aliases(self, change_map, node=None):
return
+class ExtraWhere(object):
+ def __init__(self, sqls, params):
+ self.sqls = sqls
+ self.params = params
+
+ def as_sql(self, qn=None, connection=None):
+ return " AND ".join(self.sqls), tuple(self.params or ())
+
class Constraint(object):
"""
An object that can be passed to WhereNode.add() and knows how to