Query Constraints
Query Constraints
Bases: NormanBaseModel
Container object defining query constraints for filtering, sorting, and paginating backend lookup operations.
A QueryConstraints instance can include one or more of:
A filter tree (logical expression)
A sort tree
Pagination instructions
Fields
filter (
Optional[FilterClause]) Root filter clause describing complex logical filtering using nested clauses and nodes. If omitted, no filtering is applied.sort (
Optional[SortClause]) Sorting instructions, represented as a tree of sort nodes.Nonemeans no ordering is enforced.page (
Optional[PageClause]) Pagination configuration specifyinglimitandoffset. IfNone, pagination defaults are determined by the API endpoint.
Filter Clause
Bases: NormanBaseModel
Represents a composite filter expression, allowing nested logical conditions (AND/OR) across multiple filter nodes or sub-clauses.
A FilterClause forms part of a tree structure enabling complex, arbitrarily nested filtering logic.
Fields
children (
list[Union[FilterClause, FilterNode]]) A list of either:FilterClause- sub-clause for groupingFilterNode- leaf comparison expressionjoin_condition (
UnaryRelation) Logical operator used to join child nodes:UnaryRelation.ANDUnaryRelation.OR
Filter Node
Bases: NormanBaseModel
Leaf node representing a single comparison expression used in filtering.
A FilterNode specifies a column, operator, and value to compare against, optionally scoped to a particular table.
Fields
table (
str) Table or entity name that the filter applies to.column (
str) Column name within the table. Defaults to"ID".operator (
BinaryRelation) Comparison operator such as:BinaryRelation.EQBinaryRelation.NEBinaryRelation.GTBinaryRelation.GTEBinaryRelation.LTBinaryRelation.LTEBinaryRelation.INBinaryRelation.NOT_IN
value (
FilterTypeVar) Value to compare against. Fully parameterized as:FilterTypeValue- single scalar valuestrintfloat
FilterTypeCollection- multi-value collection Used primarily with operators likeINorNOT_IN.list[FilterTypeValue]set[FilterTypeValue]tuple[FilterTypeValue]
Thus value may be either:
A single scalar (e.g.,
"A",42,3.14), orA collection of scalars (e.g.,
["A", "B"],{1, 2},(3, 4, 5)).
Sort Clause
Bases: NormanBaseModel
Represents a structured sort definition consisting of one or more sort directives ordered by priority.
Fields
children (
list[SortNode]) Ordered list of sort instructions.
Sort Node
Bases: NormanBaseModel
Single sort instruction specifying how to order records based on a particular column and sort direction.
Fields
table (
str) Table or entity name used for sorting.column (
str) Column name to sort by. Defaults to"ID".direction (
SortDirection) Direction of sorting:SortDirection.ASCSortDirection.DESC
Sort Direction
Bases: str, Enum
Sort direction enum used to specify ascending or descending order.
Values
ASC - Sort in ascending order
DESC - Sort in descending order
Page Clause
Bases: NormanBaseModel
Pagination configuration specifying record range selection.
Fields
limit (
Optional[int]) Maximum number of records to return.Nonemeans no explicit limit.offset (
Optional[int]) Starting position in the record set. Useful for page-based navigation.