diff options
| author | Ian Kelly <ian.g.kelly@gmail.com> | 2008-04-29 20:55:10 +0000 |
|---|---|---|
| committer | Ian Kelly <ian.g.kelly@gmail.com> | 2008-04-29 20:55:10 +0000 |
| commit | db6bab5cb385e53570ec768892d6882708d8feb4 (patch) | |
| tree | c4fbfa65bffb29e082d9e4b30796d67d55032677 /django/db/models/sql | |
| parent | 2061b3f3ca959cc847790ba4b4ee3b23ca31aa52 (diff) | |
Fixed an Oracle error on double negations in where conditions. Fixed #7111
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7509 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/where.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index c8857a01fe..3e8bfed087 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -51,12 +51,12 @@ class WhereNode(tree.Node): format = '(%s)' elif isinstance(child, tree.Node): sql, params = self.as_sql(child, qn) - if len(child.children) == 1: + if child.negated: + format = 'NOT (%s)' + elif len(child.children) == 1: format = '%s' else: format = '(%s)' - if child.negated: - format = 'NOT %s' % format else: sql, params = self.make_atom(child, qn) format = '%s' |
