Query

Specialized has_any and has_all query lookups for flag enumerations.

class django_enum.query.HasAllFlagsLookup(lhs, rhs)[source]

Bases: Exact

Extend Exact lookup to support lookup on has all flags. This lookup bitwise ANDs the column with the lookup value and checks that the result is equal to the lookup value.

get_rhs_op(connection, rhs)[source]
lookup_name = 'has_all'
process_lhs(compiler, connection, lhs=None)[source]
class django_enum.query.HasAnyFlagsLookup(lhs, rhs)[source]

Bases: HasAllFlagsLookup

Extend Exact lookup to support lookup on has any flags. This bitwise ANDs the column with the lookup value and checks that the result is greater than zero.

get_rhs_op(connection, rhs)[source]
lookup_name = 'has_any'
process_rhs(compiler, connection)[source]