mirror of
https://github.com/django/django.git
synced 2025-07-28 15:44:20 +00:00
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:
parent
c1d795df45
commit
6ed7bd5609
4 changed files with 17 additions and 22 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue