17 lines
335 B
Python
17 lines
335 B
Python
from typing import Optional
|
|
from pydantic import BaseModel
|
|
|
|
class CommentsBase(BaseModel):
|
|
comment_text: str
|
|
post_id: int
|
|
|
|
class CommentsCreate(CommentsBase):
|
|
pass
|
|
|
|
class Comments(CommentsBase):
|
|
id: int
|
|
created_at: Optional[str] = None
|
|
updated_at: Optional[str] = None
|
|
|
|
class Config:
|
|
orm_mode = True |