#29429: Postgres ArrayField doesn't work properly.
-------------------------------------+-------------------------------------
Reporter: creative3000 | Owner:
| creative3000
Type: Bug | Status: assigned
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
-------------------------------------+-------------------------------------
Changes (by creative3000):
* owner: nobody => creative3000
* status: new => assigned
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:
{{{
#!python
Post.objects.filter(tags__len=1)
}}}
But if you try to annotate something an error pops up example:
{{{
#!python
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
{{{
#!python
Post.objects.all().annotate(tag_len=Func(F('tags'), 1,
function='array_length'))
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29429#comment:2>
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.5d460b5a4e583925dba0f04cac50a1ab%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.