Fields
FilterField
¶
FilterField(
default: Any = PydanticUndefined,
*,
target: Optional[str] = None,
type_: Union[FilterTypeLiteral, FilterType, None] = None,
**field_kwargs: Any
) -> FilterFieldInfo
Create a field for objects that can be configured.
Used to provide extra information about a field.
PARAMETER | DESCRIPTION |
---|---|
default |
Default value to be passed to pydantic.Field.
TYPE:
|
target |
Target for filtering. |
type_ |
Filter type.
TYPE:
|
**field_kwargs |
Other arguments to pass to pydantic.Field.
TYPE:
|
Source code in pydantic_filters/filter/_fields.py
SearchField
¶
SearchField(
default: Any = PydanticUndefined,
*,
target: Sequence[str],
type_: Union[SearchTypeLiteral, SearchType, None] = None,
**field_kwargs: Any
) -> SearchFieldInfo
Create a field for objects that can be configured.
Used to provide extra information about a field.
PARAMETER | DESCRIPTION |
---|---|
default |
Default value to be passed to pydantic.Field.
TYPE:
|
target |
Target for search. |
type_ |
Search type.
TYPE:
|
**field_kwargs |
Other arguments to pass to pydantic.Field.
TYPE:
|
Source code in pydantic_filters/filter/_fields.py
FilterFieldInfo
¶
FilterFieldInfo(
*,
target: Optional[str] = None,
type_: Optional[FilterType] = None,
is_sequence: Optional[bool] = None,
field_kwargs: Optional[Dict[str, Any]] = None
)
Bases: BaseField
This class holds information about a filter field.
FilterFieldInfo is used for any filter field definition regardless of whether the
FilterField()
function is explicitly used.
Warning
You generally shouldn't be creating FilterFieldInfo
directly,
you'll only need to use it when accessing
BaseFilter
.filter_fields internals.
PARAMETER | DESCRIPTION |
---|---|
target |
Target for filtering. |
type_ |
Filter type.
TYPE:
|
is_sequence |
Is the field annotated as sequence. |
field_kwargs |
Other arguments to pass to pydantic.Field. |
Source code in pydantic_filters/filter/_fields.py
SearchFieldInfo
¶
SearchFieldInfo(
*,
target: Sequence[str],
type_: Optional[SearchType] = None,
is_sequence: Optional[bool] = None,
field_kwargs: Optional[Dict[str, Any]] = None
)
Bases: BaseField
This class holds information about a search field.
SearchFieldInfo is used for any search field definition regardless
of whether the SearchField()
function is explicitly used.
Warning
You generally shouldn't be creating SearchFieldInfo
directly,
you'll only need to use it when accessing
BaseFilter
.search_fields internals.
PARAMETER | DESCRIPTION |
---|---|
target |
Target for search. |
type_ |
Search type.
TYPE:
|
is_sequence |
Is the field annotated as sequence. |
field_kwargs |
Other arguments to pass to pydantic.Field. |