ValueObject field
Field descriptor for embedding value objects within aggregates or entities.
Bases: Field
Represents a field that holds a value object.
This field is used to embed a value object within an entity. It provides functionality to handle the value object's fields and their values.
| PARAMETER | DESCRIPTION |
|---|---|
value_object_cls
|
The class of the value object to be embedded.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
embedded_fields |
A dictionary that holds the embedded fields of the value object.
TYPE:
|
Source code in src/protean/fields/embedded.py
59 60 61 62 63 64 65 66 67 68 | |
embedded_fields
cached
property
embedded_fields
Property to retrieve embedded fields
get_shadow_fields
get_shadow_fields()
Return shadow field Primarily used during Entity initialization to register shadow field
Source code in src/protean/fields/embedded.py
139 140 141 142 143 144 145 | |
as_dict
as_dict(value)
Return JSON-compatible value of self
Source code in src/protean/fields/embedded.py
156 157 158 159 160 161 162 163 164 165 166 167 | |
__set__
__set__(instance, value)
Override __set__ to coordinate between value object and its embedded fields
Source code in src/protean/fields/embedded.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |