Fat models and skinny views? #459
Unanswered
sebastian-philipp
asked this question in
Q&A
Replies: 1 comment
-
I am not a expert, personally I think it's ok to query database during Pydantic running just like model serializer in rest-framework.And no need to raise validate exception in view layer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to get some advice from the experts here. Hopefully I'm not the only one with this question in mind.
We need to write lots of trivial and not so trivial business logic and data validation somewhere in our code bases. Especially for the data validation, I'm a bit confused with django-ninja.
Having data validation in the API, has some implications:
On the other hand, my thoughts on fat models are:
Finally, having a layer in between the API and models is also questionable
Is there a canonical way to do things? My current approach is a mix of both, but that feels duplicated here and there.
Beta Was this translation helpful? Give feedback.
All reactions