mirror of
https://github.com/a-mayb3/Kanban_clone_backend.git
synced 2026-03-21 10:05:38 +01:00
Base pydantic models for task managment
This commit is contained in:
parent
41ca480363
commit
b3899de769
1 changed files with 26 additions and 0 deletions
26
tasks.py
Normal file
26
tasks.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from enum import Enum
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import List, Annotated, Optional
|
||||
import models
|
||||
from database import SessionLocal, engine
|
||||
from sqlalchemy.orm import Session, joinedload
|
||||
|
||||
class TaskStatus(str, Enum):
|
||||
PENDING = "pending"
|
||||
IN_PROGRESS = "in_progress"
|
||||
COMPLETED = "completed"
|
||||
FAILED = "failed"
|
||||
STASHED = "stashed"
|
||||
|
||||
class TaskBase(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
title: str
|
||||
description: Optional[str] = None
|
||||
status: TaskStatus = TaskStatus.PENDING
|
||||
|
||||
class TaskList(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
tasks: List[TaskBase]
|
||||
Loading…
Add table
Add a link
Reference in a new issue