1/app/api/v1/schemas/posts.py
2025-03-20 10:46:50 +01:00

18 lines
412 B
Python

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