Use DateRangeField
offered by django.contrib.postgres
instead of primitive start and end date
#33
Labels
challenge
Should pose considerable difficulty
enhancement
New feature or request
good first issue
Good for newcomers
The mixins
PeriodMixin
andBlurryPeriodMixin
use the start and end date very primitively. They might be replaced with aDateRangeField
offered by thedjango.contrib.postgres
package, which has very efficient range overlap functions (currently written by hand in the model).The goal is to understand if
DateRangeField
suits all our usecases and if it does, rewrite the period mixins to use the more advanced method of dealing with dateranges. Even if it doesn'tpsycopg2.extras
providesDateTimeTZRange
and__contained_by
lookup that can be used for more efficient checking of whether the range is past, current or due.The text was updated successfully, but these errors were encountered: