Another Step in the Quest to clean up the code base.

This commit is contained in:
2017-09-08 07:19:50 +02:00
parent ce218080b2
commit b3ab9798b5
229 changed files with 1915 additions and 15175 deletions

View File

@@ -1,14 +1,22 @@
# -*- encoding: UTF-8 -*-
"""
Created on 30.09.2011
@author: christian
"""
""" Content processor to display upcoming events on every page you want. """
from django.core.cache import cache
from .models import Event
def upcoming_events(request):
def events_overview(request): # Ignore PyLintBear (W0613)
"""
Adds event information as variables to the template context on every page.
For speed reasons everything will be cached for an hour. the following
variables will be added to the template context:
* current_event: If an event is running at this moment, the correspondi
event object.
* next_event: the next event that is upcoming.
* upcoming_events: the next 3 events that are upcoming.
:param request: An Django HTTPRequest object
:return: dict() with the new context variables
"""
current_event = cache.get('current_event', False)
next_event = cache.get('next_event', False)
upcoming_events = cache.get('upcoming_events', False)