-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Idea: A script should only update fields that are hidden or readOnly, otherwise user edits get lost.
Implementation
code-generator https://github.com/koxudaxi/datamodel-code-generator?tab=readme-ov-file#all-command-options with
--field-include-all-keys
at this location
Lines 402 to 416 in 13c7af3
| os.system( | |
| f"{exec_path} \ | |
| --input {schema_path} \ | |
| --input-file-type jsonschema \ | |
| --output {temp_model_path} \ | |
| --base-class osw.model.static.OswBaseModel \ | |
| --use-default \ | |
| --enum-field-as-literal all \ | |
| --use-title-as-name \ | |
| --use-schema-description \ | |
| --use-field-description \ | |
| --encoding utf-8 \ | |
| --use-double-quotes \ | |
| --collapse-root-models \ | |
| --reuse-model \ |
uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")accessable through
model.Entity.__fields__["uuid"].field_info.extra["options"]["hidden"]
Override of __setattribute__ (s. a. https://github.com/OO-LD/oold-python/blob/74e4f4c417184d45bc3d8bad7bb98a91cad25061/src/oold/drafts/magic_field.py#L35)
could check if the field is readOnly or hidden and allow writes only in this case
Metadata
Metadata
Assignees
Labels
No labels