mauflix/source/main/views.py

32 lines
782 B
Python
Raw Normal View History

2020-12-05 19:38:14 -06:00
from django.shortcuts import render
from django.http import HttpResponse
from django.db.models import F
from django.views.decorators.csrf import csrf_exempt
from .models import Movie, Person
def home(request):
2022-11-17 17:51:43 -06:00
context = {"sections": Movie.objects.home_pick()}
return render(request, "home.html", context)
2020-12-05 19:38:14 -06:00
def search(request, prefix, query):
context = {"movies": Movie.objects.get_movies(prefix, query)}
2022-11-17 17:51:43 -06:00
return render(request, "search.html", context)
2020-12-05 19:38:14 -06:00
2022-11-17 17:51:43 -06:00
def about(request):
context = {}
return render(request, "about.html", context)
2020-12-05 19:38:14 -06:00
2022-11-17 17:51:43 -06:00
def bugs(request):
context = {}
return render(request, "bugs.html", context)
2020-12-05 19:38:14 -06:00
2022-11-17 17:51:43 -06:00
def movie(request, id):
context = {"movie": Movie.objects.get_movie_by_id(id)}
2022-11-17 17:51:43 -06:00
return render(request, "movie.html", context)