Answer the question
In order to leave comments, you need to log in
How to select from date ranges in Django?
Hi all!
I got into a dead end, but I think for the experienced it's like two fingers.
There is a concert model. And it has several dates with different durations. That is, it can go both one day and one week (range). Dates can be added/edited at any time. Implemented like this:
---------------------------------------- ------------------------
class Event(models.Model):
name = models.CharField(max_length=200)
# тут куча других полей
period = models.ForeignKey(Period)
class Period(models.Model):
begin = models.DateField(blank=True, null=True)
end = models.DateField(blank=True, null=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question