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 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`` --------------------