Source: factory.core/extend.delegate/ObjSerialization.py
Object serialization and field injection mixin.
Provides:
| Method | Signature | Description |
|---|---|---|
| inject_blank | inject_blank(obj, prefix: str = '_', filter_ = 0) -> None |
Set all fields on target object to empty. |
| extract | extract(obj, prefix: str = '_', to_prefix: str = '_') -> None |
Copy field values from source object to self. |
| inject_hidden | inject_hidden(target: object) -> None |
Copy private (_) attributes to target. |
| inject | inject(target: object) -> None |
Copy public attributes to target. |
| inject_dictionary | inject_dictionary(inject_dict: dict) -> None |
Set fields from a dict with title-cased keys. |
| encode_class_json | encode_class_json() -> dict |
Encode object state as a dict with class |
| encode_json | encode_json() -> str |
Encode object state as a JSON string. |
| decode_class_json | decode_class_json(d: dict) -> None |
Restore object state from a class dict. |
| decode_json | decode_json(json_str: str) -> None |
Restore object state from a JSON string. |