Settings¶
- class rest_filters.conf.AppSettings¶
There are a few settings that change how
rest-filtersbehaves globally. Most of these settings can also be changed on a per-FilterSet basis.You can use these settings by adding the
REST_FILTERSsetting to your Django configuration file. For example:REST_FILTERS = { "BLANK": "keep", "KNOWN_PARAMETERS": ["page", "page_size"], }
- BLANK: Literal['keep', 'omit'] = 'omit'¶
Determines how empty query parameters are handled. Default is
omitwhich behaves as if query parameter was not provided. Setting this tokeepwill cause empty values to be parsed by the related field.
- DEFAULT_GROUP: str = 'chain'¶
The default group for filters. By default, this is set to the reserved group
chain, which will chainfilter()calls for each resolved query expression.
- HANDLE_UNKNOWN_PARAMETERS: bool = True¶
Decides whether to handle unknown parameters.
- KNOWN_PARAMETERS: list[str] = 1¶
A list of query parameters that are not defined in FilterSet but otherwise used by other mechanisms, such as pagination.
By default, the following query parameters are marked as known:
page
page_size
cursor
api_settings.ORDERING_PARAMapi_settings.VERSION_PARAMapi_settings.URL_FORMAT_OVERRIDE