Added omitted documentation for ArrayField__len.

This commit is contained in:
Marc Tamlyn 2014-05-22 13:42:31 +01:00
parent 3545f31bcf
commit 48348782e6
1 changed files with 14 additions and 0 deletions

View File

@ -157,6 +157,20 @@ the SQL operator ``&&``. For example::
>>> Post.objects.filter(tags__overlap=['thoughts', 'tutorial'])
[<Post: First post>, <Post: Second post>, <Post: Third post>]
.. fieldlookup:: arrayfield.len
len
~~~
Returns the length of the array. The lookups available afterwards are those
available for :class:`~django.db.models.IntegerField`. For example::
>>> Post.objects.create(name='First post', tags=['thoughts', 'django'])
>>> Post.objects.create(name='Second post', tags=['thoughts'])
>>> Post.objects.filter(tags__len=1)
[<Post: Second post>]
.. fieldlookup:: arrayfield.index
Index transforms