Skip to content

filters

Collection filter datastructures.

BeforeAfter dataclass

Data required to filter a query on a datetime column.

after class-attribute

after: datetime | None

Filter results where field later than this.

before class-attribute

before: datetime | None

Filter results where field earlier than this.

field_name class-attribute

field_name: str

Name of the model attribute to filter on.

CollectionFilter dataclass

Bases: Generic[T]

Data required to construct a `WHERE ...

IN (...)` clause.

field_name class-attribute

field_name: str

Name of the model attribute to filter on.

values class-attribute

values: abc.Collection[T]

Values for IN clause.

LimitOffset dataclass

Data required to add limit/offset filtering to a query.

limit class-attribute

limit: int

Value for LIMIT clause of query.

offset class-attribute

offset: int

Value for OFFSET clause of query.