Files
benchcoach-django/teams/views.py
2021-11-14 17:41:30 -06:00

21 lines
582 B
Python

from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from django.urls import reverse
from .forms import TeamForm
from .models import Team
from lib.views import BenchcoachListView, BenchcoachEditView
def root(request):
return redirect(reverse('teams list'))
class TeamsListView(BenchcoachListView):
Model = Team
edit_url = 'edit team'
list_url = 'teams list'
page_title = "Teams"
class TeamEditView(BenchcoachEditView):
Model = Team
edit_url = 'edit team'
list_url = 'teams list'
Form = TeamForm