mdocument.model.field.FieldSynced¶
-
class
mdocument.model.field.
FieldSynced
(document_cls: Type[MDocument], optional: bool = False, relation: Type[Relation] = None, unique: bool = False, sync_fields: List[str] = None)¶ Bases:
mdocument.model.field.Field
Field where its value is a copy of a specified document. Made for performance.
-
__init__
(document_cls: Type[MDocument], optional: bool = False, relation: Type[Relation] = None, unique: bool = False, sync_fields: List[str] = None)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(document_cls[, optional, relation, …])Initialize self.
connect_to_model
(model, name)Saves field model relation.
to_dict
()validate
(value)Validates that value matches Document model.
Attributes
SENSITIVE_PLACEHOLDER
is_primary
is_related
-
connect_to_model
(model: Type[Model], name: str)¶ Saves field model relation.
-
validate
(value)¶ Validates that value matches Document model.
-