Fixed #198 -- istartswith and iendswith weren't working properly. Thanks, brantley

git-svn-id: http://code.djangoproject.com/svn/django/trunk@321 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-26 18:38:44 +00:00
parent 8a86e7713f
commit 5a3da949fa
1 changed files with 2 additions and 2 deletions

View File

@ -1645,9 +1645,9 @@ class Field(object):
return ["%%%s%%" % prep_for_like_query(value)]
elif lookup_type == 'iexact':
return [prep_for_like_query(value)]
elif lookup_type == 'startswith':
elif lookup_type in ('startswith', 'istartswith'):
return ["%s%%" % prep_for_like_query(value)]
elif lookup_type == 'endswith':
elif lookup_type in ('endswith', 'iendswith'):
return ["%%%s" % prep_for_like_query(value)]
elif lookup_type == 'isnull':
return []