Skip to main content

DataContains

This class provides a PostgreSQL-specific lookup for checking if one data structure contains another using the "@ >" operator. It extends the standard lookup functionality to support containment queries within database operations.

Attributes

AttributeTypeDescription
lookup_namestring = "contains"The identifier used in Django querysets to invoke the containment lookup.
postgres_operatorstring = "@ >"The specific PostgreSQL operator used in the generated SQL to check if one data structure contains another.

Constructor

Signature

def DataContains()

Methods


lookup_name()

def lookup_name() - > string

The identifier used in Django query filters to trigger this specific lookup.

Returns

TypeDescription
stringThe string 'contains' used in ORM queries.

postgres_operator()

def postgres_operator() - > string

The specific PostgreSQL operator used to perform the containment check in the database.

Returns

TypeDescription
stringThe '@ >' operator string used for JSONB or Array containment.