5min chapter

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

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode