Pipelinen parannuksia building blockeilla
This commit is contained in:
18
zipit/loop_runs/v5_feedback/schemas.py
Normal file
18
zipit/loop_runs/v5_feedback/schemas.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from datetime import date
|
||||
|
||||
class TaskCreate(BaseModel):
|
||||
title: str = Field(..., min_length=1, max_length=255)
|
||||
description: str | None = Field(None, max_length=255)
|
||||
due_date: date | None = Field(None)
|
||||
status: str = Field('pending', regex='^(pending|completed)$')
|
||||
|
||||
class TaskResponse(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
description: str | None
|
||||
due_date: date | None
|
||||
status: str
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user