2023-06-10 19:33:06 +00:00
|
|
|
|
|
|
|
from django.views.generic import TemplateView, ListView, DetailView
|
2023-06-11 18:37:03 +00:00
|
|
|
from django.views.generic.edit import CreateView, UpdateView, DeleteView
|
2023-06-10 19:33:06 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
|
|
|
|
from guild.models import Character
|
|
|
|
|
|
|
|
|
|
|
|
class CreateCharacterView(LoginRequiredMixin, CreateView):
|
|
|
|
model = Character
|
|
|
|
fields = ["name", "description", "player"]
|
|
|
|
|
|
|
|
class CharacterDetailView(LoginRequiredMixin, DetailView):
|
2023-06-11 18:37:03 +00:00
|
|
|
model = Character
|
|
|
|
|
|
|
|
class CharacterUpdateView(LoginRequiredMixin, UpdateView):
|
|
|
|
model = Character
|
|
|
|
fields = ["name", "description", "player"]
|
|
|
|
|
|
|
|
class CharacterDeleteView(LoginRequiredMixin, DeleteView):
|
|
|
|
model = Character
|
|
|
|
success_url = "/"
|