def now(request): drinks = get_current(Drink) announcements = get_current(Announcement) meals = [] now = datetime.now().time() for meal in list(Meal.objects.filter(day=date.today())): if meal.type.start < now and meal.type.end > now: meals.append(meal) try: events = Event.get(datetime.now(), datetime.now() + timedelta(minutes=15)) except IOError: events = [] return {'announcements': announcements, 'drinks': drinks, 'meals': meals, 'events': events}
def drinks(request): return {'drinks': get_current(Drink)}
def announcements(request): return {'announcements': get_current(Announcement)}