From d5797ae57d4822ee77091c8e8e5d35e5f4efca53 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Thu, 25 Jun 2026 13:34:14 -0400 Subject: [PATCH 1/2] Refs #37188 -- Used a more realistic --ignore in compilemessages example. --- docs/ref/django-admin.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 8e3de60c4f9c..dfd8063fe4d9 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -193,7 +193,7 @@ Example usage: .. console:: - django-admin compilemessages --ignore=cache --ignore=outdated/*/locale + django-admin compilemessages --ignore=node_modules --ignore=outdated/*/locale ``createcachetable`` -------------------- From 99672c672a1537aeb0d1fd5911ca6f04154cc091 Mon Sep 17 00:00:00 2001 From: Mike Edmunds Date: Thu, 25 Jun 2026 10:47:12 -0700 Subject: [PATCH 2/2] Refs #36593, #37187 -- Avoided spurious select_related() warning in ModelAdmin. Changed QuerySet.select_related() "called with no arguments" deprecation warning to be issued only when called from outside Django. This prevents a confusing, cascading warning when ModelAdmin issues its own warning for list_select_related=True (see 122f0b62) and then calls QuerySet.select_related() to implement the deprecated behavior. --- django/db/models/query.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index 3ede5220cc03..2d9bcee9bc96 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -37,7 +37,11 @@ resolve_callables, ) from django.utils import timezone -from django.utils.deprecation import RemovedInDjango70Warning, RemovedInDjango71Warning +from django.utils.deprecation import ( + RemovedInDjango70Warning, + RemovedInDjango71Warning, + warn_about_external_use, +) from django.utils.functional import cached_property from django.utils.warnings import django_file_prefixes @@ -1795,11 +1799,11 @@ def select_related(self, *fields): else: # RemovedInDjango70Warning: when the deprecation ends, raise a # TypeError instead. - warnings.warn( + warn_about_external_use( "Calling select_related() with no arguments is deprecated. " "Specify the fields to fetch instead.", category=RemovedInDjango70Warning, - skip_file_prefixes=django_file_prefixes(), + skip_name_prefixes=("django.db.models",), ) obj.query.select_related = True return obj