📜  django 中的 username__icontains - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:58.851000             🧑  作者: Mango

代码示例1
'''Text based fields have a selection of matching operations.'''

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

'''
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.
'''