From 4f4f32147c1d341eaa3d7fc951d804e374caa1c8 Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 24 May 2010 17:57:12 +0000 Subject: [PATCH] support case insensitive "contains" git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@873 e071eeec-0327-468d-9b6a-08194a12b294 --- ldapdb/models/fields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldapdb/models/fields.py b/ldapdb/models/fields.py index 5e85062..e074a6a 100644 --- a/ldapdb/models/fields.py +++ b/ldapdb/models/fields.py @@ -33,7 +33,7 @@ class CharField(fields.CharField): return ["*%s" % escape_ldap_filter(value)] elif lookup_type == 'startswith': return ["%s*" % escape_ldap_filter(value)] - elif lookup_type == 'contains': + elif lookup_type in ['contains', 'icontains']: return ["*%s*" % escape_ldap_filter(value)] elif lookup_type == 'exact': return [escape_ldap_filter(value)] @@ -48,7 +48,7 @@ class CharField(fields.CharField): return "*%s" % escape_ldap_filter(value) elif lookup_type == 'startswith': return "%s*" % escape_ldap_filter(value) - elif lookup_type == 'contains': + elif lookup_type in ['contains', 'icontains']: return "*%s*" % escape_ldap_filter(value) elif lookup_type == 'exact': return escape_ldap_filter(value) -- 2.30.2