Commit 48348782 authored by Marc Tamlyn's avatar Marc Tamlyn
Browse files

Added omitted documentation for ArrayField__len.

parent 3545f31b
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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