tori.db.criteria

class tori.db.criteria.Criteria

Criteria

Note

The current implementation does not support filtering on associated entities.

build_cursor(repository, force_loading=False, auto_index=False)

Build the cursor

Parameters:
  • repository (tori.db.repository.Repository) – the repository
  • force_loading (bool) – force loading on any returned entities
  • auto_index (bool) – the flag to automatically index sorting fields

Note

This is mainly used by a repository internally.

limit(limit)

Define the filter limit

Parameters:limit (int) – the filter limit
order(field, direction=<class 'ASCENDING'>)

Define the returning order

Parameters:
  • field (str) – the sorting field
  • direction – the sorting direction
start(offset)

Define the filter offset

Parameters:offset (int) – the filter offset
where(key_or_full_condition, filter_data=None)

Define the condition

Parameters:
  • key_or_full_condition (str or dict) – either the key of the condition (e.g., a field name, $or, $gt etc.)
  • filter_data – the filter data associating to the key
class tori.db.criteria.Order

Sorting Order Definition

ASC

Ascending Order

alias of ASCENDING

DESC

Descending Order

alias of DESCENDING

Read the Docs v: v2.1
Versions
latest
v2.1
v2.0
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.