Skip to content

Commit

Permalink
models:file - add default factory for File.uuid using uuid4
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Oct 31, 2023
1 parent 6a87f6c commit 781e9b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Literal
from typing import Optional
from typing import Union
from uuid import uuid4

from pydantic import Field
from pydantic import UUID4
Expand Down Expand Up @@ -63,7 +64,7 @@ class ActionIgnore(TypedDict):
class File(ACABase):
"""File data model."""

uuid: UUID4
uuid: UUID4 = Field(default_factory=lambda: uuid4())
checksum: str
puid: Optional[str]
relative_path: Path = Field(primary_key=True)
Expand Down

0 comments on commit 781e9b6

Please sign in to comment.