Skip to content

Commit

Permalink
Reviewed and modified schemas for Project and Storage Unit Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmacalintal committed Dec 20, 2024
1 parent afb1636 commit 57ee527
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dinapy/schemas/project_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Attachment(BaseSchema):
class Meta:
type_ = 'attachment'
type_ = 'metadata'

class ProjectSchema(Schema):
id = fields.Str(load_only=True)
Expand All @@ -23,7 +23,7 @@ class ProjectSchema(Schema):
multilingualDescription = SkipUndefinedField(fields.Dict,allow_none=True,attribute="attributes.multilingualDescription")
extensionValues = SkipUndefinedField(fields.Dict,allow_none=True,attribute="attributes.extensionValues")

attachment = create_relationship("project","attachment")
attachment = create_relationship("project","metadata","attachment")

meta = fields.DocumentMeta()

Expand Down
4 changes: 2 additions & 2 deletions dinapy/schemas/storageunitusageschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class StorageUnitUsage(Schema):
createdOn = SkipUndefinedField(fields.DateTime, load_only=True,attribute="attributes.createdOn")
createdBy = SkipUndefinedField(fields.Str, load_only=True,attribute="attributes.createdBy")

storageUnit = create_relationship("storage-unit-usage","storageUnit")
storageUnitType = create_relationship("storage-unit-usage","storageUnitType")
storageUnit = create_relationship("storage-unit-usage","storage-unit","storageUnit")
storageUnitType = create_relationship("storage-unit-usage","storage-unit-type","storageUnitType")

@post_load
def set_none_to_undefined(self, data, **kwargs):
Expand Down

0 comments on commit 57ee527

Please sign in to comment.