[Django] #36379: add TSTZRANGE postgres function to django.contrib.postgres.functions

8 views
Skip to first unread message

Django

unread,
May 9, 2025, 12:37:34 PMMay 9
to django-...@googlegroups.com
#36379: add TSTZRANGE postgres function to django.contrib.postgres.functions
-------------------------------------+-------------------------------------
Reporter: anthony sottile | Type: New
| feature
Status: new | Component:
| contrib.postgres
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
I believe something like

{{{
class TsTzRange(models.Func):
function = "TSTZRANGE"
output_field = DateTimeRangeField()
}}}

https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-
CONSTRUCT
--
Ticket URL: <https://code.djangoproject.com/ticket/36379>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 9, 2025, 12:48:53 PMMay 9
to django-...@googlegroups.com
#36379: add TSTZRANGE postgres function to django.contrib.postgres.functions
----------------------------------+--------------------------------------
Reporter: anthony sottile | Owner: (none)
Type: New feature | Status: new
Component: contrib.postgres | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Comment (by anthony sottile):

TSRANGE would be nice as well to get the non-timezone equivalent
--
Ticket URL: <https://code.djangoproject.com/ticket/36379#comment:1>

Django

unread,
May 12, 2025, 3:57:00 AMMay 12
to django-...@googlegroups.com
#36379: add TSTZRANGE postgres function to django.contrib.postgres.functions
----------------------------------+--------------------------------------
Reporter: anthony sottile | Owner: (none)
Type: New feature | Status: closed
Component: contrib.postgres | Version: 5.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Sarah Boyce):

* resolution: => wontfix
* status: new => closed

Comment:

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
[https://github.com/orgs/django/projects/24 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/36379#comment:2>

Django

unread,
Jul 19, 2025, 6:11:32 AMJul 19
to django-...@googlegroups.com
#36379: add TSTZRANGE postgres function to django.contrib.postgres.functions
----------------------------------+--------------------------------------
Reporter: anthony sottile | Owner: (none)
Type: New feature | Status: closed
Component: contrib.postgres | Version: 5.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Comment (by Anthony Sottile):

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
--
Ticket URL: <https://code.djangoproject.com/ticket/36379#comment:3>
Reply all
Reply to author
Forward
0 new messages