guild-journal/guild/views/player.py

22 lines
603 B
Python

from django.views.generic import TemplateView, ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin
from guild.models import Player
class CreatePlayerView(LoginRequiredMixin, CreateView):
model = Player
fields = ["name"]
class PlayerDetailView(LoginRequiredMixin, DetailView):
model = Player
class PlayerUpdateView(LoginRequiredMixin, UpdateView):
model = Player
fields = ["name"]
class PlayerDeleteView(LoginRequiredMixin, DeleteView):
model = Player
success_url = "/"