Login
Back to bricks list
Introduction Version

PrimitiveRField

RFeeld for primitives values, use subclass and not this one directly

:param BaseRField: [description] :type BaseRField: [type] :return: [description] :rtype: [type]

Attributes

include_in_dict_view: boolsearchable: boolvalidator: Validator

Functions

__INIT__
              It also checks the default value
               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:
NameTypeDefault valueDescription
validatorValidator Validator used on serialization and deserialization to verify r_field_value type
searchablebool False If true, the field value is saved in the db and could be search on a request , optional
default_valueAny Default value of the resource attribute union[type, callable[[], ], int, float, str, bool], optional
include_in_dict_viewbool True If true, this field we be included in the default dict view , optional
DESERIALIZE
Parameters:
NameTypeDefault valueDescription
r_field_valueAny
Return type:
Any
GET_DEFAULT_VALUE
Return type:
Any
SERIALIZE
Parameters:
NameTypeDefault valueDescription
r_field_valueAny
Return type:
Any