poulpe/shared/views.py
2018-08-26 21:18:51 +02:00

13 lines
389 B
Python

from django.views.generic import TemplateView
from django.utils import timezone
from event.models import Event
class Home(TemplateView):
template_name = "shared/home.html"
def get_context_data(self):
context = super().get_context_data()
context['events'] = Event.objects.filter(ending_date__gte=timezone.now()).order_by('beginning_date')
return context