#23709: postgres ArrayField can't access specific array indices in .values(),
.aggregate(), etc.
----------------------------------+--------------------------------------
Reporter: kalenedrael | Owner:
Type: Uncategorized | Status: new
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: arrayfield | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by kalenedrael):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> ArrayField allows lookups by index when filtering, e.g.
> {{{
> qset.filter(arr__0=foo)
> }}}
> but things like
> {{{
> qset.values('arr__0')
> qset.aggregate(Max('arr__0')
> }}}
> are not allowed.
>
> I'm not sure if this counts as a feature request or bug. From a cursory
> look at the Django source it seems that this functionality may not be
> compatible with the way Django handles lookups outside of .filter().
New description:
ArrayField allows lookups by index when filtering, e.g.
{{{
qset.filter(arr__0=foo)
}}}
but things like
{{{
qset.values('arr__0')
qset.aggregate(Max('arr__0'))
}}}
are not allowed.
I'm not sure if this counts as a feature request or bug. From a cursory
look at the Django source it seems that this functionality may not be
compatible with the way Django handles lookups outside of .filter().
--
--
Ticket URL: <https://code.djangoproject.com/ticket/23709#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/069.594bec7122f0587a4ec111af2ff93c33%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.