jordaneremieff / djantic

Pydantic model support for Django
https://github.com/jordaneremieff/djantic
MIT License
456 stars 34 forks source link

Import exported model data to create/update existing records #11

Closed jordaneremieff closed 2 years ago

jordaneremieff commented 4 years ago
data = SchemaModel.dict()
imported = SchemaModel.parse_django(data)

The parse_django maybe would have a different name, but this is what I'm generally thinking for the API.

jordaneremieff commented 2 years ago

I think this would not be particularly useful given the model schema doesn't handle retrieval or updating the underlying model instances - better left to the queryset API.