diff options
author | Josh Schneier <josh.schneier@gmail.com> | 2015-02-04 01:01:59 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-02-04 07:31:43 -0500 |
commit | 7d363ed43247a80d2b764723e1bf6e0e6da4e82f (patch) | |
tree | 9aa2e57ef525d75812d63b7e5651e6bdd5d2275e | |
parent | 79f27f2b61aeac763ae048416ef8a97c2b639ae8 (diff) | |
download | django-7d363ed43247a80d2b764723e1bf6e0e6da4e82f.tar.gz |
Fixed typos of "select_related" in docs and tests.
-rw-r--r-- | docs/ref/models/querysets.txt | 4 | ||||
-rw-r--r-- | tests/defer/tests.py | 4 | ||||
-rw-r--r-- | tests/defer_regress/tests.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index c54fa6d014..df0e135e79 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -787,8 +787,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 acc87d88b6..8471976173 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 1222212d8d..87638bb99d 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) |