3/app/api/v1/schemas/posts.py
2025-03-20 12:49:08 +01:00

16 lines
366 B
Python

from typing import Optional
from pydantic import BaseModel
# Posts schema
class PostsCreate(BaseModel):
title: str
content: str
published: bool = True
class Posts(BaseModel):
id: int
title: str
content: str
published: bool
created_at: Optional[str] = None
updated_at: Optional[str] = None
class Config:
orm_mode = True