Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

username__icontains in django

'''Text based fields have a selection of matching operations.'''

'''For e.g.'''
>>> Author.objects.filter(name__contains='Terry')
[<Author: Terry Gilliam>, <Author: Terry Jones>]

'''
This is not a proper solution sice this requires the user to know
the exact substring of the name.
Here the icontains operation can come in handy and it is a better approach
since it is a case-insensitive match.
'''
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django
ADD COMMENT
Topic
Name
7+5 =