From 273dc550a4eccdad958541f456332312b3369504 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 26 Jun 2013 01:07:18 -0700 Subject: Fixed #20462 -- null/non-string regex lookups are now consistent Thanks to noirbizarre for the report and initial patch. --- django/db/backends/postgresql_psycopg2/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/backends/postgresql_psycopg2/operations.py') diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py index f96757da8b..c5aab84693 100644 --- a/django/db/backends/postgresql_psycopg2/operations.py +++ b/django/db/backends/postgresql_psycopg2/operations.py @@ -69,7 +69,7 @@ class DatabaseOperations(BaseDatabaseOperations): # Cast text lookups to text to allow things like filter(x__contains=4) if lookup_type in ('iexact', 'contains', 'icontains', 'startswith', - 'istartswith', 'endswith', 'iendswith'): + 'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'): lookup = "%s::text" # Use UPPER(x) for case-insensitive lookups; it's faster. -- cgit v1.2.1