summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorMiguel <miguel.almonte1@gmail.com>2017-09-23 23:59:02 -0400
committerTim Graham <timograham@gmail.com>2017-09-27 09:28:35 -0400
commit5b38d7e97334089dc3e76ed5ff66d876b74734bb (patch)
tree98ae3c5e4c99fe7a0f451b4d8cf2fef531913486 /docs/ref/models
parentecea60fee884bc41613b8afcb4cca39c8f2fa538 (diff)
[2.0.x] Clarified StrIndex docs example.
Backport of 4a908c0cd23fa4da621938203ee2d910b179dbf8 from master
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/database-functions.txt5
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index f5a9af3a05..410db7881c 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -259,10 +259,9 @@ Usage example::
>>> Author.objects.create(name='Margaret Smith')
>>> Author.objects.create(name='Smith, Margaret')
>>> Author.objects.create(name='Margaret Jackson')
- >>> authors = Author.objects.annotate(
+ >>> Author.objects.filter(name='Margaret Jackson').annotate(
... smith_index=StrIndex('name', V('Smith'))
- ... ).order_by('smith_index')
- >>> authors.first().smith_index
+ ... ).get().smith_index
0
>>> authors = Author.objects.annotate(
... smith_index=StrIndex('name', V('Smith'))