Abstract class that must be extended to define RField that are dump and load directly into a file
Attributes
include_in_dict_view: bool
searchable: bool
Functions
Only small amount of data can be mark as searchable, defaults to False
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 |
---|---|---|---|
default_value | Any | Default value of the resource attribute union[type, callable[[], ], int, float, str, bool], optional |
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
r_field_value | str |
Return type:
Any |
Implement this method to dump your object into a file to be able to load it later. This method is called when the resource is saved.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
r_field_value | Any | Object to dump (value of the r_field) | |
file_path | str | Path of the file to dump (the object must be dumped into this file) |
Return type:
Any |
Implement this method to load your object from the file. This method is called when the RField of the resource is loaded.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
file_path | str | Path of the file |
Return type:
Any |
METHOD NOT USED. Ignore this method.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
r_field_value | Any |
Return type:
str |