#27694: Improve documentation of supported lookups on HStore & JSON fields
--------------------------------------+------------------------------------
Reporter: Stephen Burrows | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Mariusz Felisiak):
Replying to [comment:9 Sarah Abderemane]:
> I'd be happy to help on this issue but HStore is new for me,
{{{iexact}}} on HStoreField lookup, it's based on which SQL operator ?
> Same as ''contains'' {{{@>}}} but it's with case-insensitive or another
one ?
`iexact` and other text-lookups should work on
[https://github.com/django/django/blob/492ed60f236d770eb9a6d56d85ff2550bb1ecfff/django/contrib/postgres/fields/hstore.py#L79-L88
key transforms] on `HStoreField` because it returns `TextField`. Maybe
it's enough to add a similar note to the one about `JSONField`, e.g.:
{{{
.. note::
Key transforms can also be chained with: :lookup:`contains`,
:lookup:`icontains`, :lookup:`endswith`, :lookup:`iendswith`,
:lookup:`iexact`, :lookup:`regex`, :lookup:`iregex`,
:lookup:`startswith`,
and :lookup:`istartswith`.
}}}
This is untested so some tests will also be required.
--
Ticket URL: <https://code.djangoproject.com/ticket/27694#comment:10>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.50dadc351ee2268dfdecb9f296d1833a%40djangoproject.com.