mirror of
https://github.com/a-mayb3/Kanban_clone_backend.git
synced 2026-03-21 10:05:38 +01:00
Base pydantic models for project managment
This commit is contained in:
parent
b3899de769
commit
05eb7e0e5c
1 changed files with 25 additions and 0 deletions
25
projects.py
Normal file
25
projects.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from tasks import TaskBase
|
||||||
|
from users import UserBase
|
||||||
|
|
||||||
|
class ProjectBase(BaseModel):
|
||||||
|
model_config = ConfigDict(from_attributes=True)
|
||||||
|
|
||||||
|
id: int
|
||||||
|
name: str
|
||||||
|
description: str
|
||||||
|
tasks: List[TaskBase]
|
||||||
|
users: List[UserBase]
|
||||||
|
|
||||||
|
class ProjectCreate(BaseModel):
|
||||||
|
name: str
|
||||||
|
description: Optional[str] = None
|
||||||
|
tasks: List[TaskBase] = []
|
||||||
|
user_ids: List[int] = []
|
||||||
|
|
||||||
|
class ProjectList(BaseModel):
|
||||||
|
model_config = ConfigDict(from_attributes=True)
|
||||||
|
|
||||||
|
projects: List[ProjectBase]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue