

def lookup_cast(self, lookup_type):
    lookup = '%s'
    if (lookup_type in ('iexact', 'contains', 'icontains', 'startswith', 'istartswith', 'endswith', 'iendswith')):
        lookup = '%s::text'
    if (lookup_type in ('iexact', 'icontains', 'istartswith', 'iendswith')):
        lookup = ('UPPER(%s)' % lookup)
    return lookup

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/db/backends/postgresql/operations.py DatabaseOperations.lookup_cast/original