Welcome to thecut-durationfield¶
This app provides a custom Django model field, RelativeDeltaField
, and
related form fields and widgets. RelativeDeltaField
stores time durations
using ISO 8601 representations, and returns dateutil.relativedelta
objects which may be used directly with datetime.datetime
objects.
This project was inspired by packages such as django-durationfield. However, this project focuses on:
- providing a database-agnostic, standards-compliant way of storing the durations in the database (using ISO 8601).
- returning
dateutil.relativedelta
objects that can be used to perform calculations ondatetime.datetime
objects.
Note that django-durationfield provides the ability to filter querysets
based on the relative size of the stored duration, which is not possible with
this project. I.e., you can’t use __lt
and __gt
etc., when filtering
by fields provided by this project.
Documentation¶
The full documentation is at https://thecut-durationfield.readthedocs.org.
Quickstart¶
Install thecut-durationfield
using the Installation instructions.