“pydantic arbitrary_types_allowed” Respostas de código

pydantic arbitrary_types_allowed

from pydantic import BaseModel as PydanticBaseModel


class BaseModel(PydanticBaseModel):
    class Config:
        arbitrary_types_allowed = True


class MyClass:
    """A random class"""


class Model(BaseModel):
    x: MyClass
Crowded Caracal

pydantic arbitrary_types_allowed

from pydantic import BaseModel as PydanticBaseModel


class BaseModel(PydanticBaseModel):
    class Config:
        arbitrary_types_allowed = True


class MyClass:
    """A random class"""


class Model(BaseModel):
    x: MyClass
Crowded Caracal

Respostas semelhantes a “pydantic arbitrary_types_allowed”

Procure respostas de código populares por idioma

Procurar outros idiomas de código