20 lines
491 B
Python
20 lines
491 B
Python
from pydantic import BaseModel, EmailStr, Field, validator
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
#
|
|
import re
|
|
from enum import Enum
|
|
|
|
class CommentCreate(BaseModel):
|
|
texto: str = Field(..., max(380), min(30))
|
|
user_id: Optional[int]
|
|
feed_id: Optional[int]
|
|
is_active: bool = True
|
|
|
|
class Commentupdate(CommentCreate):
|
|
pass
|
|
class CommentResponse(CommentCreate):
|
|
created_at: datetime
|
|
cretaed_by: int
|
|
class MessageResponse(BaseModel):
|
|
message: str |