#24169: ArrayField can't use __contained_by or __overlap queries for CharField
----------------------------------+-----------------------
Reporter: joelburton | Owner:
Type: Uncategorized | Status: new
Component: contrib.postgres | Version: 1.8alpha1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------+-----------------------
ArrayField's lookup.py uses the @> operator for __contains, the <@
operator for __contained_by, and the && operator for __overlap.
When the field uses CharField (Postgres' varchar()), __contains works, but
__contained_by and __overlap do not, as Postgres does not define <@ and &&
operators for an array of varchar[] (it does for text[]).
__contains works because, in array.py, there is a custom lookup,
"ArrayOverlap", the outputs a cast to cast the array query value to, say,
"::varchar(10)[]"
If there are similar custom lookups for __contained_by and __overlap,
these then work.
--
Ticket URL: <https://code.djangoproject.com/ticket/24169>
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/053.b17aae814ca381d87eac0b1bc2ab240d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.