Opened 4 months ago

Closed 4 months ago

Last modified 7 weeks ago

#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 anthony sottile, 4 months ago

TSRANGE would be nice as well to get the non-timezone equivalent

comment:2 by Sarah Boyce, 4 months ago

Resolution: wontfix
Status: newclosed

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 Anthony Sottile, 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

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