From 48348782e65438829147d0d066276d1caa0d485b Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Thu, 22 May 2014 13:42:31 +0100 Subject: [PATCH] Added omitted documentation for ArrayField__len. --- docs/ref/contrib/postgres/fields.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/ref/contrib/postgres/fields.txt b/docs/ref/contrib/postgres/fields.txt index dcde84d2ec..85ba6096b5 100644 --- a/docs/ref/contrib/postgres/fields.txt +++ b/docs/ref/contrib/postgres/fields.txt @@ -157,6 +157,20 @@ the SQL operator ``&&``. For example:: >>> Post.objects.filter(tags__overlap=['thoughts', 'tutorial']) [, , ] +.. 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) + [] + .. fieldlookup:: arrayfield.index Index transforms