Closed Bishwas-py closed 3 months ago
I am trying to return content type of my model via this inheritable schema:
class HasContentType(Schema): content_type: int @field_validator('content_type', mode="before") def validate_content_type(cls, content_type): print("content_type> ", content_type) print(content_type, "content_type.id> ", content_type.id) return content_type.id
but it clashes with
class Schema(BaseModel): """ Enhance to automatically detect many-to-many fields for serialization. """ model_config = ConfigDict(validate_default=True, validate_assignment=True, from_attributes=True, arbitrary_types_allowed=True) content_type: ClassVar = "application/json" # here description: ClassVar[dict] = {}
I think renaming content_type to something else is required.
650974b1ab7783dae2b958802dd26a3e48f1d7c5 fixed it.
I am trying to return content type of my model via this inheritable schema:
but it clashes with
I think renaming content_type to something else is required.