#36379 closed New feature (wontfix)
add TSTZRANGE postgres function to django.contrib.postgres.functions
Reported by: | anthony sottile | Owned by: | |
---|---|---|---|
Component: | contrib.postgres | Version: | 5.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I believe something like
class TsTzRange(models.Func): function = "TSTZRANGE" output_field = DateTimeRangeField()
https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-CONSTRUCT
Change History (3)
comment:1 by , 4 months ago
comment:2 by , 4 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Thank you for the suggestion! When suggesting a new feature for Django, the feature should first be proposed and discussed with the community. To do that, please raise this on the new feature tracker where you'll receive feedback from the community.
I'll close the ticket for now, but if the community agrees with the proposal, please return to this ticket and reference the feature discussion so we can re-open it.
In terms of my opinion here, this isn't very much code for folks to add to their project if they need to use this function. I would like us to be clear on what functions should be added to django.contrib.postgres.functions
and which shouldn't, in order to understand if this "fits". I would be interested in adding this if we agree this fits with a broader plan of what we should provide out the box.
comment:3 by , 7 weeks ago
ah, figured this would be a fairly trivial addition to django.contrib.postgres.functions
where a few other misc database functions already reside: https://github.com/django/django/blob/main/django/contrib/postgres/functions.py
TSRANGE would be nice as well to get the non-timezone equivalent