def get_db_lookup_expression(self, lookup_type, value, connection):
        # If this is the "exact" lookup type, then explicitly
        # typecast our value to the proper type.
        if lookup_type == 'exact':
            return '{field} = {value}::%s' % self.db_type(connection)

        # If `__contains` was used to seek an item within the array,
        # return the appropriate PostgreSQL expression to handle that.
        if lookup_type == 'contains':
            if isinstance(value, (list, tuple)):
                return self.db_type(connection) % '{field} @> {value}::%s'
            return '{value} = ANY({field})'

        # If the lookup_type is "len", then we are asking for
        # an array of a given length.
        if lookup_type == 'len':
            if value:
                return '{value} = ARRAY_LENGTH({field}, 1)'
            return 'ARRAY_LENGTH({field}, 1) IS NULL'
dataset/ETHPy150Open lukesneeringer/django-pgfields/django_pg/models/fields/array.py/ArrayField.get_db_lookup_expression/swapped operands of `%`