This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
2017-08-25 18:03:37 +00:00
|
|
|
from django.shortcuts import render
|
2017-11-10 13:55:39 +00:00
|
|
|
from django.shortcuts import render
|
|
|
|
from django.views import View
|
|
|
|
from django.views.generic.base import TemplateView
|
|
|
|
from django.conf import settings
|
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.http import HttpResponseRedirect
|
|
|
|
|
|
|
|
from LandingPage.models import Show
|
|
|
|
from LandingPage.models import Season
|
|
|
|
from LandingPage.models import Episode
|
2017-08-25 18:03:37 +00:00
|
|
|
|
|
|
|
# Create your views here.
|
2017-11-10 13:55:39 +00:00
|
|
|
|
|
|
|
class Index (TemplateView):
|
|
|
|
template_name = "show.html"
|
|
|
|
|
|
|
|
def get_context_data(self, abbreviation, **kwargs):
|
|
|
|
ctx = super().get_context_data()
|
|
|
|
ctx['show'] = Show.objects.filter(abbr=abbreviation).first()
|
|
|
|
ctx['seasons'] = Season.objects.filter(show=ctx['show'])
|
|
|
|
ctx['episodes'] = Episode.objects.filter(show=ctx['show'])
|
|
|
|
return ctx
|