Django Chat cover image

Optimizing Django Queries - Jamie Matthews

Django Chat

CHAPTER

Zen Queries: A Context Manager for Query Evaluation

Django encourages you to put your business logic in the model layer, essentially. But Django's migration framework doesn't really handle this very well. So Zen queries is a context manager that lets you mark a block of code as not being able to run queries - and it will raise an exception for doing so. This can help avoid problems like end queries which are often caused by nested loops or complex object graphs. Jamie has spent a lot of time thinking about how to solve these problems with his open source toolset called Zen queries.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner