Back to bricks list
Introduction
Technical Documentation
Other Classes
SearchBuilder
Version

SearchBuilder

Builder to make dynamic search query with And operator

:raises BadRequestException: [description] :raises BadRequestException: [description] :return: [description] :rtype: [type]

Functions

__INIT__

Create a search build to make dynamic search

Parameters:
NameTypeDefault valueDescription
model_typeType Peewee type of the model to search [model]
default_ordersList Define a default sort for the request, defaults to none [ordering], optional
ADD_EXPRESSION
Parameters:
NameTypeDefault valueDescription
expressionExpression
Return type:
SearchBuilderType
ADD_JOIN
Parameters:
NameTypeDefault valueDescription
tableType
onExpression
Return type:
SearchBuilderType
ADD_ORDERING
Parameters:
NameTypeDefault valueDescription
orderOrdering
Return type:
SearchBuilderType
ADD_SEARCH_PARAMS
Parameters:
NameTypeDefault valueDescription
searchSearchParams
Return type:
SearchBuilderType
CONVERT_FILTER_TO_EXPRESSION
Parameters:
NameTypeDefault valueDescription
filter_SearchFilterCriteria
Return type:
Expression
CONVERT_ORDER_TO_PEEWEE_ORDERING

Convert a search order criteria to a peewee ordering

Parameters:
NameTypeDefault valueDescription
orderSearchSortCriteria
Return type:
Ordering
CONVERT_VALUE

Method to convert the search value (or values) to type of field

Parameters:
NameTypeDefault valueDescription
fieldField
valueAny
Return type:
Any
SEARCH_ALL
Return type:
List
SEARCH_PAGE
Parameters:
NameTypeDefault valueDescription
pageint 0
number_of_items_per_pageint 20
Return type:
Paginator
SET_ORDERING
Parameters:
NameTypeDefault valueDescription
ordersList
Return type:
SearchBuilderType