diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 6dca128cbde..2f3168c83e0 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -805,8 +805,8 @@ You can use ``select_related()`` with any queryset of objects:: The order of ``filter()`` and ``select_related()`` chaining isn't important. These querysets are equivalent:: - Entry.objects.filter(pub_date__gt=timezone.now()).selected_related('blog') - Entry.objects.selected_related('blog').filter(pub_date__gt=timezone.now()) + Entry.objects.filter(pub_date__gt=timezone.now()).select_related('blog') + Entry.objects.select_related('blog').filter(pub_date__gt=timezone.now()) You can follow foreign keys in a similar way to querying them. If you have the following models:: diff --git a/tests/defer/tests.py b/tests/defer/tests.py index acc87d88b6a..84719761733 100644 --- a/tests/defer/tests.py +++ b/tests/defer/tests.py @@ -109,13 +109,13 @@ class DeferTests(AssertionMixin, TestCase): self.assertEqual(obj.related_id, self.s1.pk) self.assertEqual(obj.name, "p1") - def test_defer_selected_related_raises_invalid_query(self): + def test_defer_select_related_raises_invalid_query(self): # When we defer a field and also select_related it, the query is # invalid and raises an exception. with self.assertRaises(InvalidQuery): Primary.objects.defer("related").select_related("related")[0] - def test_only_selected_related_raises_invalid_query(self): + def test_only_select_related_raises_invalid_query(self): with self.assertRaises(InvalidQuery): Primary.objects.only("name").select_related("related")[0] diff --git a/tests/defer_regress/tests.py b/tests/defer_regress/tests.py index 1222212d8d8..87638bb99d2 100644 --- a/tests/defer_regress/tests.py +++ b/tests/defer_regress/tests.py @@ -219,7 +219,7 @@ class DeferRegressionTest(TestCase): self.assertEqual(obj.item, item2) self.assertEqual(obj.item_id, item2.id) - def test_proxy_model_defer_with_selected_related(self): + def test_proxy_model_defer_with_select_related(self): # Regression for #22050 item = Item.objects.create(name="first", value=47) RelatedItem.objects.create(item=item)