3 ms·
I looked for a simple solution to this recently and I couldn't find one. It would be great if implicit SQL queries that occur as a result of missing out either
by drpancake 5y ago
I looked for a simple solution to this recently and I couldn't find one. It would be great if implicit SQL queries that occur as a result of missing out either select_related() or prefetch_related() would generate a console warning.
I think this should be the default behaviour given that most beginning Django developers fall into this trap.
- jmconfuzeus 5y agoI agree. A warning should be the minimum because I don't see why anyone would consider hitting the database when accessing template context normal.
- Nextgrid 5y agoThe Django logging configuration is IMO unnecessarily complex and while it can be tuned to do anything with enough effort, I wish there was a one-click setting that says "tell me shit I should probably be aware of". I always find myself searching as to how to log SQL queries and copy/pasting the entire "LOGGING" setting temporarily despite working with the framework for several years.