magic-removal: Improved QOperator.get_sql() to NOT output parenthesis in where clause if there is no where clause

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-02-03 23:30:56 +00:00
parent a624c77cc1
commit eee4f00bfb
1 changed files with 3 additions and 1 deletions

View File

@ -451,7 +451,9 @@ class QOperator:
joins.update(joins2)
where.extend(where2)
params.extend(params2)
return tables, joins, ['(%s)' % self.operator.join(where)], params
if where:
return tables, joins, ['(%s)' % self.operator.join(where)], params
return tables, joins, [], params
class QAnd(QOperator):
"Encapsulates a combined query that uses 'AND'."