Delete duration and records from ProjectRead

This commit is contained in:
linuskmr 2021-12-23 17:58:17 +01:00
parent cd2b0c0ca1
commit 5c717d4ee9

View file

@ -19,16 +19,17 @@ class Project(ProjectBase, table=True):
"""Model used inside the database."""
id: Optional[int] = Field(default=None, primary_key=True)
creation_date: datetime = Field(default=datetime.now())
class ProjectRead(ProjectCreate):
class ProjectRead(ProjectBase):
"""Model used when querying information about a module."""
id: int
name: str # = Field(description="Name of the project", example="Learning")
start_date: datetime # = Field(description="Project creation date", example=datetime.now())
duration: timedelta # = Field(description="Total tracked duration", example=timedelta(days=3, hours=5, minutes=47))
records: int # = Field(description="Total number of trackings/records", example=42)
creation_date: datetime # = Field(description="Project creation date", example=datetime.now())
# duration: timedelta # = Field(description="Total tracked duration", example=timedelta(days=3, hours=5,
# minutes=47))
# records: int # = Field(description="Total number of trackings/records", example=42)
# class Config: # TODO: Adding this config may be done with a decorator
# """pydantic config"""