def as_sql(self, qn, connection):
        # Get the name of the field and the value that was sent.
        field = qn.compile(self.lhs)[0]
        value = self.rhs
        db_type = self.field.db_type(connection)

        # Return the appropriate SQL.
        if isinstance(value, (list, tuple)):
            return '{0}::{1} @> %s::{1}'.format(field, db_type), (value,)
        return '%s = ANY({0}::{1})'.format(field, db_type), (value,)
Hook for a database backend to use the cursor description to
dataset/ETHPy150Open lukesneeringer/django-pgfields/django_pg/lookups.py/ArrayContains.as_sql--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/db/backends/__init__.py/BaseDatabaseIntrospection.get_field_type