schemas.comment#

Module Contents#

Classes#

CommentSchema

Pydantic model for validating incoming comment data.

CommentResponse

Pydantic model for serializing comment data in responses.

API#

class schemas.comment.CommentSchema(**data: Any)#

Bases: pydantic.BaseModel

Pydantic model for validating incoming comment data.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

text: str = 'Field(...)'#
class schemas.comment.CommentResponse(**data: Any)#

Bases: schemas.comment.CommentSchema

Pydantic model for serializing comment data in responses.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

id: int = None#
user_id: int = None#
picture_id: int = None#
created_at: datetime.datetime = None#
updated_at: datetime.datetime = None#