24 lines
483 B
Python
24 lines
483 B
Python
|
|
from pydantic import BaseModel
|
||
|
|
from typing import Optional, List
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
class ProjectBase(BaseModel):
|
||
|
|
name: str
|
||
|
|
description: Optional[str] = None
|
||
|
|
|
||
|
|
class ProjectCreate(ProjectBase):
|
||
|
|
pass
|
||
|
|
|
||
|
|
class ProjectUpdate(BaseModel):
|
||
|
|
name: Optional[str] = None
|
||
|
|
description: Optional[str] = None
|
||
|
|
|
||
|
|
class Project(ProjectBase):
|
||
|
|
id: int
|
||
|
|
owner_id: int
|
||
|
|
created_at: datetime
|
||
|
|
updated_at: datetime
|
||
|
|
|
||
|
|
class Config:
|
||
|
|
from_attributes = True
|