2/app/api/v1/schemas/comments.py
2025-03-20 12:08:13 +01:00

16 lines
365 B
Python

from typing import Optional
from datetime import datetime
from pydantic import BaseModel
class CommentsCreate(BaseModel):
text: str
post_id: int
user_id: int
class Comments(BaseModel):
id: int
text: str
post_id: int
user_id: int
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
orm_mode = True