examerioLogin
← Fullstack with Vue.jsQuestion 59 of 62

What does QuerySet.defer() do in Django ORM?

📘 Explanation

defer() tells Django to leave out certain fields from the initial SQL query and fetch them with an extra query only if you actually access them, which saves resources when you don't need every field upfront. The wrong options misdescribe this: defer() doesn't permanently remove fields or raise errors, doesn't still include them in the SELECT, and doesn't cache everything else in memory.

Related questions

← PreviousNo login needed