georgebv/drf-pydantic

Collaborate with `django-pydantic-field`?

johnthagen opened this issue · 2 comments

This project seems to have a similar goal to drf-pydantic:

Perhaps the two projects could work together so that the community can use a single package with the best of both projects?

I am not sure I understand what that library does. Could you explain what's the use case in common words and what you think the overlap would be?

It looks like at it's core it's about annotating the shape/schema of JSONFields:

from django_pydantic_field import SchemaField


class Foo(pydantic.BaseModel):
    count: int
    size: float = 1.0


class MyModel(models.Model):
    # Infer schema from field annotation
    foo_field: Foo = SchemaField()

So, it looks like it would be orthogonal/additional to this library. Integration could be that they play nicely together if you nest a SchemaField inside a drf_pydantic.BaseModel.

Was doing a survey of Django/Pydantic related fields and came across both this and the other library. I don't think there is anything actionable here, so I'll close the issue.