Opened 6 years ago
Last modified 3 years ago
#30711 closed Cleanup/optimization
Document django.contrib.postgres.fields.hstore.KeyTransform. — at Version 3
| Reported by: | Gustav Eiman | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | HStoreField F |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Document django.contrib.postgres.fields.hstore.KeyTransform in the HStoreField documentation that can be used on the right hand side of a filter or an annotation.
Change History (3)
follow-up: 2 comment:1 by , 6 years ago
| Version: | 2.2 → master |
|---|
comment:2 by , 6 years ago
Replying to felixxm:
Thanks for the report, I don't think that we should support this by adding a custom expression because currently you can always use
django.contrib.postgres.fields.hstore.KeyTransform, e.g.
Person.objects.annotate(height=KeyTransform('height', 'attributes'))I don't think that we need to add anything new. IMO, documentating
django.contrib.postgres.fields.hstore.KeyTransformshould be enough.
It's more complicated for JSONField because nesting multiple
KeyTransform()is not so handy.
Thank you! I agree, I had no idea this was available.
Being a first time poster, what do I do now? Should I close this ticket?
comment:3 by , 6 years ago
| Component: | contrib.postgres → Documentation |
|---|---|
| Description: | modified (diff) |
| Owner: | set to |
| Summary: | Add HStoreF for F object like querying on HStoreField. → Document django.contrib.postgres.fields.hstore.KeyTransform. |
| Triage Stage: | Unreviewed → Accepted |
| Type: | New feature → Cleanup/optimization |
I changed ticket description, thanks!
Thanks for the report, I don't think that we should support this by adding a custom expression because currently you can always use
django.contrib.postgres.fields.hstore.KeyTransform, e.g.Person.objects.annotate(height=KeyTransform('height', 'attributes'))I don't think that we need to add anything new. IMO, documentating
django.contrib.postgres.fields.hstore.KeyTransformshould be enough.It's more complicated for JSONField because nesting multiple
KeyTransform()is not so handy.