diff options
| author | Ian Kelly <ian.g.kelly@gmail.com> | 2008-09-01 23:18:42 +0000 |
|---|---|---|
| committer | Ian Kelly <ian.g.kelly@gmail.com> | 2008-09-01 23:18:42 +0000 |
| commit | 6211527fa289f9de589b8f0bd7e17dedc93cfbf5 (patch) | |
| tree | f39288fb1b30144ffef0d353d87a91047a5c0f46 | |
| parent | 502fc3ae56fe5ba6f45547d1b4369aa16239f2d8 (diff) | |
Replaced exact lookups of the empty string with isnull lookups in Oracle. Fixes the testPreventDuplicateComments case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8827 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/models/sql/query.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 9e67e9a993..cbbbee20ba 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1050,6 +1050,10 @@ class Query(object): raise ValueError("Cannot use None as a query value") lookup_type = 'isnull' value = True + elif (value == '' and lookup_type == 'exact' and + connection.features.interprets_empty_strings_as_nulls): + lookup_type = 'isnull' + value = True elif callable(value): value = value() |
