Don't write queries inside serializers in Django!
Papan Sarkar
Posted on April 13, 2024
Why?
It should focus data conversion and validations only. Don't write database logic on this.
Not efficient and bad performance. It will create lots of queries
You can not reuse it
Very hard to test
Readability is gone
I can share the alternatives if you want! Let me know
💖 💪 🙅 🚩
Papan Sarkar
Posted on April 13, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.