Event list

This commit is contained in:
Raphael Michel
2014-09-12 21:32:14 +02:00
parent 9f3fb52cce
commit b2b653e57e
6 changed files with 67 additions and 3 deletions

View File

@@ -1,5 +1,20 @@
from django.http import HttpResponse
from django.shortcuts import render
from django.views.generic import ListView
from tixlbase.models import Event
class EventList(ListView):
model = Event
context_object_name = 'events'
template_name = 'tixlcontrol/events/index.html'
def get_queryset(self):
return Event.objects.filter(
permitted__id__exact=self.request.user.pk
).prefetch_related(
"organizer",
)
def index(request):