1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

use accordion + history table for profil view

This commit is contained in:
Pierre-antoine Comby
2019-08-15 23:11:16 +02:00
parent a84031405e
commit be8f2dc35b
2 changed files with 46 additions and 8 deletions

View File

@ -47,13 +47,17 @@ class UserCreateView(CreateView):
class UserDetailView(LoginRequiredMixin,DetailView):
model = Profile
context_object_name = "profile"
def get_context_data(slef,**kwargs):
context = super().get_context_data(**kwargs)
user = context['object'].user.note
user_transactions = \
Transaction.objects.all().filter(Q(source=user) | Q(destination=user))
context['history_list'] = user_transactions
user = context['profile'].user
history_list = \
Transaction.objects.all().filter(Q(source=user.note) | Q(destination=user.note))
context['history_list'] = HistoryTable(history_list)
club_list = \
Membership.objects.all().filter(user=user).only("club")
context['club_list'] = ClubTable(club_list)
return context