From 6211527fa289f9de589b8f0bd7e17dedc93cfbf5 Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Mon, 1 Sep 2008 23:18:42 +0000 Subject: [PATCH] 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 --- django/db/models/sql/query.py | 4 ++++ 1 file changed, 4 insertions(+) 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()