--
Ticket URL: <https://code.djangoproject.com/ticket/25487>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: mjtamlyn (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
What's the reason `DurationField` doesn't support it? How soon do we
overflow the `bigint` storage of other database backends?
--
Ticket URL: <https://code.djangoproject.com/ticket/25487#comment:1>
Comment (by liminspace):
Month is not a static value that you can convert to bigint.
See example:
TIMESTAMP '2001-02-02' + INTERVAL '1 month' = TIMESTAMP '2001-03-02'
TIMESTAMP '2001-02-02' + INTERVAL '31' days' = TIMESTAMP '2001-03-05'
--
Ticket URL: <https://code.djangoproject.com/ticket/25487#comment:2>
Comment (by mjtamlyn):
Support for non-fixed durations is complicated - As liminspace mentioned
Python's timedelta does not support months or years (see
https://docs.python.org/3.2/library/datetime.html#datetime.timedelta).
Oracle actually has two completely separate fields for them, and the other
databases we could not store it in a single column either.
Also, what is the form field representation? How do we anticipate a user
will specify "2 months, 4 days and 1 hour" (in every language?), and will
they understand that 30 days != 1 month? In fact in postgres depending on
which functions you use to calculate age, you either get calendar months
or 30 day "months".
I think this should be possible as an external field for postgres and/or
Oracle, as it has external python dependencies as well it should live as
an external package. I'm not sure what psycopg2 does for month/year based
durations as normally it will try to cast `interval` to a `timedelta`.
--
Ticket URL: <https://code.djangoproject.com/ticket/25487#comment:3>
* status: new => closed
* resolution: => wontfix
--
Ticket URL: <https://code.djangoproject.com/ticket/25487#comment:4>