45
70
# Cast text lookups to text to allow things like filter(x__contains=4)
46
71
if lookup_type in ('iexact', 'contains', 'icontains', 'startswith',
72
'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'):
50
75
# Use UPPER(x) for case-insensitive lookups; it's faster.