25 lines
628 B
Python
25 lines
628 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", "address"]
|
|
|
|
|
|
class PlayerDetailView(LoginRequiredMixin, DetailView):
|
|
model = Player
|
|
|
|
|
|
class PlayerUpdateView(LoginRequiredMixin, UpdateView):
|
|
model = Player
|
|
fields = ["name", "address"]
|
|
|
|
|
|
class PlayerDeleteView(LoginRequiredMixin, DeleteView):
|
|
model = Player
|
|
success_url = "/"
|