diff options
| author | Justin Bronn <jbronn@gmail.com> | 2010-02-23 06:04:06 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2010-02-23 06:04:06 +0000 |
| commit | 7ca3e8fecf3788d219720138be3ec80fec527ab6 (patch) | |
| tree | be550c4bcb56c5f15829d3b07e23ec0ce845a731 | |
| parent | 1d5165e3be03ffb2b886b34cf0c1377ce958d12d (diff) | |
Updated patch applied in r12504. Refs #12806.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12508 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/topics/db/sql.txt | 2 | ||||
| -rw-r--r-- | tests/modeltests/raw_query/tests.py | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt index 1433fa52a1..b909be938e 100644 --- a/docs/topics/db/sql.txt +++ b/docs/topics/db/sql.txt @@ -100,7 +100,7 @@ write:: >>> first_person = Person.objects.raw('SELECT * from myapp_person')[0] However, the indexing and slicing are not performed at the database level. If -you have a big amount of ``Person`` objects in your database, it would be more +you have a big amount of ``Person`` objects in your database, it is more efficient to limit the query at the SQL level:: >>> first_person = Person.objects.raw('SELECT * from myapp_person LIMIT 1')[0] diff --git a/tests/modeltests/raw_query/tests.py b/tests/modeltests/raw_query/tests.py index dbc5f88bb9..ceed67473f 100644 --- a/tests/modeltests/raw_query/tests.py +++ b/tests/modeltests/raw_query/tests.py @@ -196,8 +196,4 @@ class RawQueryTests(TestCase): first_two = Author.objects.raw(query)[0:2] self.assertEquals(len(first_two), 2) - try: - Author.objects.raw(query)['test'] - self.fail('Index lookups should only accept int, long or slice') - except TypeError: - pass + self.assertRaises(TypeError, lambda: Author.objects.raw(query)['test']) |
