Skip to main content

HasAnyKeys

This class provides a lookup mechanism to check if a collection or JSON field contains any of the specified keys. It maps to the PostgreSQL '?|' operator, enabling efficient filtering based on the presence of at least one key from a given list.

Attributes

AttributeTypeDescription
lookup_namestring = has_any_keysThe identifier used in query expressions to perform a search for any of the specified keys.
postgres_operatorstring = ?

Constructor

Signature

def HasAnyKeys()

Methods


lookup_name()

def lookup_name() - > string

The identifier used in Django query expressions to apply the 'has_any_keys' filter.

Returns

TypeDescription
stringThe string 'has_any_keys' used for lookup registration.

postgres_operator()

def postgres_operator() - > string

The PostgreSQL operator used to check if any of the specified keys exist in a JSONB field.

Returns

TypeDescription
stringThe PostgreSQL '?|' operator string.