[2.0.x] Clarified StrIndex docs example.
Backport of 4a908c0cd2
from master
This commit is contained in:
parent
ecea60fee8
commit
5b38d7e973
|
@ -259,10 +259,9 @@ Usage example::
|
||||||
>>> Author.objects.create(name='Margaret Smith')
|
>>> Author.objects.create(name='Margaret Smith')
|
||||||
>>> Author.objects.create(name='Smith, Margaret')
|
>>> Author.objects.create(name='Smith, Margaret')
|
||||||
>>> Author.objects.create(name='Margaret Jackson')
|
>>> Author.objects.create(name='Margaret Jackson')
|
||||||
>>> authors = Author.objects.annotate(
|
>>> Author.objects.filter(name='Margaret Jackson').annotate(
|
||||||
... smith_index=StrIndex('name', V('Smith'))
|
... smith_index=StrIndex('name', V('Smith'))
|
||||||
... ).order_by('smith_index')
|
... ).get().smith_index
|
||||||
>>> authors.first().smith_index
|
|
||||||
0
|
0
|
||||||
>>> authors = Author.objects.annotate(
|
>>> authors = Author.objects.annotate(
|
||||||
... smith_index=StrIndex('name', V('Smith'))
|
... smith_index=StrIndex('name', V('Smith'))
|
||||||
|
|
Loading…
Reference in New Issue