The Wire · Showcase
DJANGO DEPRECATES SELECT_RELATED() WITH NO ARGUMENTS
By RepoJournal · Filed · About Django
Django is removing the footgun of calling `select_related()` without arguments, forcing developers to be explicit about which relations they want to optimize.
The main event is a deprecation wave [1] that closes off a common mistake: calling `QuerySet.select_related()` with no args used to load every relation, defeating the purpose of the method entirely. This lands alongside a companion deprecation [2] that removes the corresponding `ModelAdmin.list_select_related = True` shortcut, which had the same problem. The infrastructure work behind this is solid—the team also removed unnecessary ordering from compound queries [3] and cleaned up test dependencies on generated columns [4], both of which reduce unnecessary database operations. On the admin side, hardcoded primary keys are gone from permission tests [5], making the test suite more maintainable as it scales. Benchmark infrastructure is tracking performance across ubuntu-latest [6], so you'll see the real-world impact of these changes roll in.
Action items
- → Audit your codebase for bare select_related() calls before the next Django LTS django/django [plan]
- → Check ModelAdmin subclasses for list_select_related = True and replace with explicit tuples django/django [plan]
References
- [1] Fixed #36593 -- Deprecated QuerySet.select_related() with no arguments. ↗ django/django
- [2] Refs #36593 -- Deprecated setting ModelAdmin.list_select_related to True. django/django
- [3] Fixed #36938 -- Removed unnecessary ordering from compound queries. django/django
- [4] Removed constraints' test_validate_nullable_condition dependency on generated columns. django/django
- [5] Removed hardcoded pks in AdminViewPermissionsTest. django/django
- [6] Results for ubuntu-latest added [skip ci] django/django-asv
FAQ
- What changed in Django on May 12, 2026?
- Django is removing the footgun of calling `select_related()` without arguments, forcing developers to be explicit about which relations they want to optimize.
- What should Django teams do about it?
- Audit your codebase for bare select_related() calls before the next Django LTS • Check ModelAdmin subclasses for list_select_related = True and replace with explicit tuples
- Which Django repositories shipped on May 12, 2026?
- django/django, django/django-asv