mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Restructure our python module. A lot.
This commit is contained in:
21
src/pretix/control/views/main.py
Normal file
21
src/pretix/control/views/main.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import ListView
|
||||
|
||||
from pretix.base.models import Event
|
||||
|
||||
|
||||
class EventList(ListView):
|
||||
model = Event
|
||||
context_object_name = 'events'
|
||||
template_name = 'pretixcontrol/events/index.html'
|
||||
|
||||
def get_queryset(self):
|
||||
return Event.objects.current.filter(
|
||||
permitted__id__exact=self.request.user.pk
|
||||
).prefetch_related(
|
||||
"organizer",
|
||||
)
|
||||
|
||||
|
||||
def index(request):
|
||||
return render(request, 'pretixcontrol/base.html', {})
|
||||
Reference in New Issue
Block a user