eadwinCode / ninja-schema

Ninja Schema is Pydantic full support for Django ORM.
MIT License
41 stars 0 forks source link

What is the difference between this ninja-schema and django-ninja model schema #12

Open DrJfrost opened 1 month ago

DrJfrost commented 1 month ago

As the title says I find a little redundant to recreate the modelchema

https://django-ninja.dev/guides/response/django-pydantic/ shouldn't the original django-ninja modelschemabe used?

eadwinCode commented 3 weeks ago

@DrJfrost ninja-schema compiles to django model fields to pydantic fields with validations based on the field in question. For example, an email field won't result to just a string type pydantic field but also a string type with email validation

eadwinCode commented 3 weeks ago

There are other features too if you check the readme.md

DrJfrost commented 3 weeks ago

wouldn't it be better to extend the ninja's buitlin modelschema? from a large project perspective having to install 3 extra packages just to set up a rest api seems a bit too much. or at least make it part of the ninja-extra setup. if the project is oriented to be django friendly it should then inherently include all the tools in it. just like DRF does with views viewset's modelviewset etc

eadwinCode commented 3 weeks ago

@DrJfrost I think it's a good idea to move it into the django-ninja extra. Thanks for the suggestions. It will be done in future releases of django-ninja extra