Fixed #12855 -- QuerySets with extra where parameters now combine correctly. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2010-02-23 04:39:39 +00:00
parent c1d795df45
commit 6ed7bd5609
4 changed files with 17 additions and 22 deletions

View file

@ -84,12 +84,6 @@ class SQLCompiler(object):
if where:
result.append('WHERE %s' % where)
params.extend(w_params)
if self.query.extra_where:
if not where:
result.append('WHERE')
else:
result.append('AND')
result.append(' AND '.join(self.query.extra_where))
grouping, gb_params = self.get_grouping()
if grouping:
@ -124,7 +118,6 @@ class SQLCompiler(object):
result.append('LIMIT %d' % val)
result.append('OFFSET %d' % self.query.low_mark)
params.extend(self.query.extra_params)
return ' '.join(result), tuple(params)
def as_nested_sql(self):