django-pydantic-field icon indicating copy to clipboard operation
django-pydantic-field copied to clipboard

Django JSONField with Pydantic models as a Schema

Results 16 django-pydantic-field issues
Sort by recently updated
recently updated
newest added

If I define a model like the example: ```python class MyModel(models.Model): # Infer schema from field annotation foo_field: Foo = SchemaField() ``` Then I go ahead and create an empty...

Along with DRF's schema generators, it would be handy to have an adapter for `def-spectacular`, as it's becoming de-facto standard tool for OpenAPI schema generation in DRF.

enhancement

I have the following pydantic models: ```python class EUTaxonomyValue(BaseModel): type: Literal["eu_taxonomy"] = "eu_taxonomy" nace_code: str economic_activity: str classification: str | None class EconomicActivity(BaseModel): type: Literal["economic_activity"] = "economic_activity" activity_code: str activity_name:...

Since Pydantic v2, it looks feasible to walk through the _what-is-called `CoreSchema`_, which is used by `pydantic_core` to perform the data validation/serialization. This opens up the door to get rid...

enhancement
pydantic:2

Is there a way to disable validation on retrieval? Currently Django will throw a 500 error if I have an object with an invalid schema in the database. Even when...

The docs we have at the moment only cover essential use cases, with lots of details missing. This indeed should be expanded. What should be added, to my knowledge: -...

documentation
enhancement
good first issue

Currently it's not possible to automatically infer corresponding serializer field type for `PydanticSchemaField`. Some third-party libraries patch `ModelSerializer` field registry to achieve such behaviour. What I'd like to know is:...

This is more likely relevant to serializer fields, though may still apply to parsers/renderers, that needs to be figured out. While rendering serializer schema, we can come up in the...

enhancement