Author: ikelly
Date: 2008-09-01 18:18:42 -0500 (Mon, 01 Sep 2008)
New Revision: 8827
Modified:
django/trunk/django/db/models/sql/query.py
Log:
Replaced exact lookups of the empty string with isnull lookups in Oracle.
Fixes the testPreventDuplicateComments case.
Modified: django/trunk/django/db/models/sql/query.py
===================================================================
--- django/trunk/django/db/models/sql/query.py 2008-09-01 23:06:39 UTC (rev
8826)
+++ django/trunk/django/db/models/sql/query.py 2008-09-01 23:18:42 UTC (rev
8827)
@@ -1050,6 +1050,10 @@
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()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---