Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DateRangeField offered by django.contrib.postgres instead of primitive start and end date #33

Open
dhruvkb opened this issue Nov 11, 2018 · 0 comments
Labels
challenge Should pose considerable difficulty enhancement New feature or request good first issue Good for newcomers

Comments

@dhruvkb
Copy link
Member

dhruvkb commented Nov 11, 2018

The mixins PeriodMixin and BlurryPeriodMixin use the start and end date very primitively. They might be replaced with a DateRangeField offered by the django.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't psycopg2.extras provides DateTimeTZRange and __contained_by lookup that can be used for more efficient checking of whether the range is past, current or due.

@dhruvkb dhruvkb added enhancement New feature or request good first issue Good for newcomers labels Nov 11, 2018
@pradumangoyal pradumangoyal added the challenge Should pose considerable difficulty label Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge Should pose considerable difficulty enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants