+ @classmethod
+ def get_current(cls, time=None):
+ time = (time or now()).astimezone(get_current_timezone())
+ weekday = time.isoweekday()
+ qs = cls.objects.filter(is_active=True)
+ qs = qs.exclude(min_hour__gt=time.hour).exclude(max_hour__lte=time.hour)
+ qs = qs.exclude(min_day_of_month__gt=time.day).exclude(max_day_of_month__lte=time.day)
+ qs = qs.exclude(**{f'dow_{weekday}': False})
+ return qs
+