Files
agentic-studio/zipit/template_runs/tmpl_blog/schemas.py
2026-04-12 18:48:14 +03:00

36 lines
613 B
Python

from pydantic import BaseModel
from datetime import date
class UserCreate(BaseModel):
username: str
email: str
password_hash: str
class UserResponse(UserCreate):
id: int
class Config:
from_attributes = True
class ArticleCreate(BaseModel):
title: str
content: str
author_id: int
class ArticleResponse(ArticleCreate):
id: int
class Config:
from_attributes = True
class CommentCreate(BaseModel):
content: str
article_id: int
author_id: int
class CommentResponse(CommentCreate):
id: int
class Config:
from_attributes = True