<gh_stars>0
from django.shortcuts import render
from django.views.generic import TemplateView, ListView, DetailView
from .models import Team
from fixtures.models import Fixture


class IndexView(TemplateView):
    template_name = "index.html"

    def get_context_data(self, *args, **kwargs):
        context = super(IndexView, self).get_context_data(*args, **kwargs)
        context["team_list"] = Team.objects.all().order_by("team_name")
        context["fixture_list"] = Fixture.objects.all().order_by("date_time")
        return context


class TeamListView(ListView):
    model = Team
    
    
class TeamDetailView(DetailView):
    model = Team