-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from HDRUK/GAT-3769
Update origin fields to be enum lists only
- Loading branch information
Showing
6 changed files
with
138 additions
and
116 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from typing import Optional, List, Union | ||
from pydantic import BaseModel, Field | ||
from hdr_schemata.definitions.HDRUK import * | ||
|
||
from .annotations import annotations | ||
|
||
an = annotations.provenance.origin | ||
|
||
|
||
class Origin(BaseModel): | ||
class Config: | ||
extra = "forbid" | ||
|
||
purpose: Optional[List[Purpose]] = Field(None, **an.purpose.__dict__) | ||
source: Optional[List[Source]] = Field(None, **an.source.__dict__) | ||
collectionSituation: Optional[ | ||
List[Setting] | ||
] = Field(None, **an.collectionSituation.__dict__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from hdr_schemata.models.HDRUK.v2_2_0 import Provenance as BaseProvenance | ||
from pydantic import Field | ||
from typing import Optional | ||
from .Origin import Origin | ||
|
||
from .annotations import annotations | ||
|
||
an = annotations.provenance | ||
|
||
|
||
class Provenance(BaseProvenance): | ||
|
||
origin: Optional[Origin] = Field( | ||
None, description=an.origin.description, title=an.origin.title | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters