RField, these fields must be used in resource attribute. When a class attribute is instantiated with an RField, it will be automatically save for output resource of a task and automatically initiated for input resource of a task
This field support a deserializer and serializer function to implement custom logic for saving and instantiating a resource
Attributes
include_in_dict_view: bool
searchable: bool
Functions
[summary]
Only small amount of data can be mark as searchable, defaults to False
It is also possible to extend the RField class and override the deserialization method
It is also possible to extend the RField class and override the serialization method
Support primitive value, Type of Callable function
If type or callable, it will be called without parameter to initialise the default value, defaults to None
Do not mark huge fields as include in dict view, defaults to False
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
searchable | bool | False | If true, the field value is saved in the db and could be search on a request , optional |
deserializer | Callable | Optional function that will be called manually deserialize the rfield value, defaults to none [[any], any], optional | |
serializer | Callable | Optional function that will be called to manually serialize the rfield value, defaults to none [[any], any], optional | |
default_value | Union | Default value of the resource attribute [type, callable[[], any], int, float, str, bool], optional | |
include_in_dict_view | bool | False | If true, this field we be included in the default dict view , optional |
Method to deserialize the r_field_value, can be overriden by a child class
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
r_field_value | Any | Value of the r_field |
Return type:
Any |
Return type:
Any |
Method to serialize the r_field_value, can be overriden by a child class
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
r_field_value | Any | Value of the r_field |
Return type:
Any |