1111class BaseSchema (BaseModel ):
1212 @property
1313 def as_db_dict (self ):
14- to_db = self .model_dump (
15- exclude_defaults = True , exclude_none = True , exclude = {"identifier, id" }
16- )
14+ to_db = self .model_dump (exclude_defaults = True , exclude_none = True , exclude = {"identifier, id" })
1715 for key in ["id" , "identifier" ]:
1816 if key in self .model_dump ().keys ():
1917 to_db [key ] = self .model_dump ()[key ].hex
@@ -23,16 +21,12 @@ def as_db_dict(self):
2321class MetadataBaseSchema (BaseSchema ):
2422 # Receive via API
2523 # https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#section-3
26- title : Optional [str ] = Field (
27- None , description = "A human-readable title given to the resource."
28- )
24+ title : Optional [str ] = Field (None , description = "A human-readable title given to the resource." )
2925 description : Optional [str ] = Field (
3026 None ,
3127 description = "A short description of the resource." ,
3228 )
33- isActive : Optional [bool ] = Field (
34- default = True , description = "Whether the resource is still actively maintained."
35- )
29+ isActive : Optional [bool ] = Field (default = True , description = "Whether the resource is still actively maintained." )
3630 isPrivate : Optional [bool ] = Field (
3731 default = True ,
3832 description = "Whether the resource is private to team members with appropriate authorisation." ,
@@ -44,22 +38,14 @@ class MetadataBaseCreate(MetadataBaseSchema):
4438
4539
4640class MetadataBaseUpdate (MetadataBaseSchema ):
47- identifier : UUID = Field (
48- ..., description = "Automatically generated unique identity for the resource."
49- )
41+ identifier : UUID = Field (..., description = "Automatically generated unique identity for the resource." )
5042
5143
5244class MetadataBaseInDBBase (MetadataBaseSchema ):
5345 # Identifier managed programmatically
54- identifier : UUID = Field (
55- ..., description = "Automatically generated unique identity for the resource."
56- )
57- created : date = Field (
58- ..., description = "Automatically generated date resource was created."
59- )
60- isActive : bool = Field (
61- ..., description = "Whether the resource is still actively maintained."
62- )
46+ identifier : UUID = Field (..., description = "Automatically generated unique identity for the resource." )
47+ created : date = Field (..., description = "Automatically generated date resource was created." )
48+ isActive : bool = Field (..., description = "Whether the resource is still actively maintained." )
6349 isPrivate : bool = Field (
6450 ...,
6551 description = "Whether the resource is private to team members with appropriate authorisation." ,
0 commit comments