Opened 5 years ago

Last modified 20 months 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 Mariusz Felisiak)

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)

comment:1 by Mariusz Felisiak, 5 years ago

Version: 2.2master

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.KeyTransform should be enough.

It's more complicated for JSONField because nesting multiple KeyTransform() is not so handy.

in reply to:  1 comment:2 by Gustav Eiman, 5 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.KeyTransform should 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 Mariusz Felisiak, 5 years ago

Component: contrib.postgresDocumentation
Description: modified (diff)
Owner: set to nobody
Summary: Add HStoreF for F object like querying on HStoreField.Document django.contrib.postgres.fields.hstore.KeyTransform.
Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

I changed ticket description, thanks!

Note: See TracTickets for help on using tickets.
Back to Top