Ellar Serializer or ModelSchema (from ninja_schema) #191
-
I'm starting writing schemas for my app, I wonder if I can use PS. I forgot to say that (obviously) I'm using Ellar with Django via https://github.com/python-ellar/ellar-django-module |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @paolodina Thanks for trying out this project. The On the other side, ninja_schema creates a pydantic model at the end of its setup. So, I think you can use it as an input/output schema for your controller. Ellar will always convert to serializer model if its a pydantic type. |
Beta Was this translation helpful? Give feedback.
-
Which is great. (*)
That's exactly how I'm utilizing the schemas now, and the controllers can use them without any issues. My confusion, which led me to try ninja_schema, stemmed from seeing some code examples that employed a DTO (btw, (*) I started the last project using django-ninja-extras, but found Ellar and restarted with it. But, what's your plans for them? What should I use? |
Beta Was this translation helpful? Give feedback.
Oh okay thats nice. So ellar-with-django project was designed to use a repository pattern. The repository interface requires a DTO to define data transfer schema. So
EventDTO
is there to serve the purpose.