add aliases view to clubs
This commit is contained in:
parent
a41e51e23a
commit
33e3657120
8 changed files with 39 additions and 29 deletions
|
|
@ -168,15 +168,14 @@ class UserListView(LoginRequiredMixin, SingleTableView):
|
|||
return context
|
||||
|
||||
|
||||
|
||||
|
||||
class AliasView(LoginRequiredMixin, FormMixin, DetailView):
|
||||
model = User
|
||||
template_name = 'member/profile_alias.html'
|
||||
context_object_name = 'user_object'
|
||||
form_class = AliasForm
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
note = context['user_object'].note
|
||||
note = context['object'].note
|
||||
context["aliases"] = AliasTable(note.alias_set.all())
|
||||
return context
|
||||
|
||||
|
|
@ -197,6 +196,11 @@ class AliasView(LoginRequiredMixin, FormMixin, DetailView):
|
|||
alias.save()
|
||||
return super().form_valid(form)
|
||||
|
||||
class ProfileAliasView(AliasView):
|
||||
model = User
|
||||
template_name = 'member/profile_alias.html'
|
||||
context_object_name = 'user_object'
|
||||
|
||||
|
||||
class DeleteAliasView(LoginRequiredMixin, DeleteView):
|
||||
model = Alias
|
||||
|
|
@ -364,6 +368,11 @@ class ClubDetailView(LoginRequiredMixin, DetailView):
|
|||
context['member_list'] = club_member
|
||||
return context
|
||||
|
||||
class ClubAliasView(AliasView):
|
||||
model = Club
|
||||
template_name = 'member/club_alias.html'
|
||||
context_object_name = 'club'
|
||||
|
||||
|
||||
class ClubUpdateView(LoginRequiredMixin, UpdateView):
|
||||
model = Club
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue