diff --git a/apps/member/views.py b/apps/member/views.py index f54103e7..487da98b 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -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 diff --git a/templates/member/profile_detail.html b/templates/member/profile_detail.html index 82be255a..fd5ebd7f 100644 --- a/templates/member/profile_detail.html +++ b/templates/member/profile_detail.html @@ -23,7 +23,41 @@