Hello everyone.
I’m working on a project where one of my models has to save a date range period, both of which are required fields. I have been needing to create these models for a past few years and always resorted to two DateFields.
Example:
class ExampleModel(models.Model):
date_from = models.DateField()
date_to = models.DateField()
This works fine, but you always have to work with two fields whenever doing something such as filtering, ordering, doing any sort of business logic.
Is there a better way to handle this type of data?