37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
from django.shortcuts import render, redirect, get_object_or_404
|
|
|
|
from . import models
|
|
|
|
def films(request):
|
|
context = {}
|
|
context['films'] = models.Film.objects.filter(public=True).order_by('created')
|
|
return render(request, 'films.html', context)
|
|
|
|
def film(request, slug):
|
|
context = {}
|
|
context['film'] = get_object_or_404(models.Film, slug=slug)
|
|
return render(request, 'film.html', context)
|
|
|
|
def film_play(request, slug):
|
|
context = {}
|
|
context['film'] = get_object_or_404(models.Film, slug=slug)
|
|
return render(request, 'film_play.html', context)
|
|
|
|
def edits(request):
|
|
context = {}
|
|
context['edits'] = models.Edit.objects.filter(public=True).order_by('created')
|
|
return render(request, 'edits.html', context)
|
|
|
|
def edit(request, slug):
|
|
context = {}
|
|
context['edit'] = get_object_or_404(models.Edit, slug=slug)
|
|
return render(request, 'edit.html', context)
|
|
|
|
def edit_play(request, slug):
|
|
context = {}
|
|
context['edit'] = get_object_or_404(models.Edit, slug=slug)
|
|
return render(request, 'edit_play.html', context)
|
|
|
|
def tv(request):
|
|
context = {}
|
|
return render(request, 'tv.html', context)
|