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
__INIT__
[summary]
searchable :
bool
- False
if true, the field value is saved in the DB and could be search on a request
Only small amount of data can be mark as searchable
deserializer :
Callable
optional function that will be called manually deserialize the RField value
serializer :
Callable
optional function that will be called to manually serialize the RField value
default_value :
Union
default value of the resource attribute
Support primitive value, Type of Callable function
If type or callable, it will be called without parameter to initialise the default value
include_in_dict_view :
bool
- False
if true, this field we be included in the default dict view
Do not mark huge fields as include in dict view
DESERIALIZE
Method to deserialize the r_field_value, can be overriden by a child class
r_field_value :
Any
value of the r_field
Return type :
Any
GET_DEFAULT_VALUE
Return type :
Any
SERIALIZE
Method to serialize the r_field_value, can be overriden by a child class
r_field_value :
Any
value of the r_field
Return type :
Any