Don't write queries inside serializers in Django!

papansarkar101

Papan Sarkar

Posted on April 13, 2024

Don't write queries inside serializers in Django!

Don't Do it

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

💖 💪 🙅 🚩
papansarkar101
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.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024