BaseQuery

Immutable query base with filtering, pagination, loading, and execution.

Usage

Source

BaseQuery(
    backend,
    *,
    context,
    model=None,
    filters=None,
    predicates=None,
    orderings=None,
    preloads=None,
    limit=None,
    offset=None,
    property_filters=None,
    parent_resource_id=None,
    parameter_filters=None,
    include_archived=False,
    local_metadata_filters=None,
    effective_metadata_filters=None,
    load_mode=None,
    on_unloaded=None
)

Methods

Name Description
all() Execute query and return all matching models or references.
count() Return matching row count without materializing rows.
export() Export one materialized query result through a registered exporter.
filter() Return clone with equality filters merged.
first() Execute query and return first match, or None.
include() Return clone requesting relation preloads.
include_archived() Return clone including archived entities.
limit() Return clone constrained to at most value rows.
offset() Return clone skipping value rows.
order_by() Return clone with orderings appended.
where() Return clone with predicates appended using AND semantics.

all()

Execute query and return all matching models or references.

Usage

Source

all()

count()

Return matching row count without materializing rows.

Usage

Source

count()

export()

Export one materialized query result through a registered exporter.

Usage

Source

export(format, destination=None)

filter()

Return clone with equality filters merged.

Usage

Source

filter(**kwargs)

first()

Execute query and return first match, or None.

Usage

Source

first()

include()

Return clone requesting relation preloads.

Usage

Source

include(relation_names)

include_archived()

Return clone including archived entities.

Usage

Source

include_archived()

limit()

Return clone constrained to at most value rows.

Usage

Source

limit(value)

offset()

Return clone skipping value rows.

Usage

Source

offset(value)

order_by()

Return clone with orderings appended.

Usage

Source

order_by(*orderings)

where()

Return clone with predicates appended using AND semantics.

Usage

Source

where(*predicates)