#29429: Postgres ArrayField doesn't work properly.
-------------------------------------+-------------------------------------
     Reporter:  creative3000         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  db orm ArrayField    |             Triage Stage:
  postgres                           |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by creative3000:

Old description:

> When you filter by len like in documentation example:
>  Post.objects.filter(tags__len=1)
>  But if you try to annotate something an error pops up example:
>  Post.objects.all().annotate(tag_len=F('tags__len'))
> It really seems that it should work by default,  but instead I needed to
> use something like this
> Post.objects.all().annotate(tag_len=Func(F('tags'), 1,
> function='array_length'))

New description:

 When you filter by len like in documentation example:
 "Post.objects.filter(tags__len=1)"
 But if you try to annotate something an error pops up example:
 "Post.objects.all().annotate(tag_len=F('tags__len'))"
 It really seems that it should work by default,  but instead I needed to
 use something like this
 "Post.objects.all().annotate(tag_len=Func(F('tags'), 1,
 function='array_length'))"

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29429#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.1ae4015032b62010d84263e73e6e38d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to