Skip to content

Commit

Permalink
models: move from site id to uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
denizs committed Aug 16, 2024
1 parent 9b961b6 commit 34659d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/enlyze/api_client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class PlatformApiModel(BaseModel):


class Site(PlatformApiModel):
id: int
uuid: UUID
name: str
address: str

def to_user_model(self) -> user_models.Site:
"""Convert into a :ref:`user model <user_models>`"""

return user_models.Site(
_id=self.id,
uuid=self.uuid,
address=self.address,
display_name=self.name,
)
Expand All @@ -39,7 +39,7 @@ class MachineBase(PlatformApiModel):

class Machine(MachineBase):
genesis_date: date
site: int
site: UUID

def to_user_model(self, site: user_models.Site) -> user_models.Machine:
"""Convert into a :ref:`user model <user_models>`"""
Expand Down
2 changes: 1 addition & 1 deletion src/enlyze/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Site:
"""

_id: int
uuid: UUID

#: Display name of the site.
display_name: str
Expand Down

0 comments on commit 34659d6

Please sign in to comment.