我有一周的开始日和一周的结束日作为配置模型中的选择
class config(models.Model)
...
DAYS_OF_WEEK = (
(0, 'Monday'),
(1, 'Tuesday'),
(2, 'Wednesday'),
(3, 'Thursday'),
(4, 'Friday'),
(5, 'Saturday'),
(6, 'Sunday'),
)
startday = models.Charfield(max_length = 1, choices=DAY_OF_WEEK)
startday = models.Charfield(max_length = 1, choices=DAY_OF_WEEK)
starttime = models.TimeField()
endtime = models.Timefield()
我有一个单独的模型,它有一个包含时间戳事件的日期时间字段。
class event(models.Model)
...
event_timestamp = models.DateTimeField()
如何获取事件模型在开始日期/时间范围内的所有配置模型?