15 lines
288 B
Python
15 lines
288 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
class CommentsBase(BaseModel):
|
|
body: str
|
|
post_id: int
|
|
user_id: int
|
|
|
|
class Comments(CommentsBase):
|
|
id: int
|
|
post: Optional[dict] = None
|
|
user: Optional[dict] = None
|
|
|
|
class Config:
|
|
orm_mode = True |