Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
66b70e69
Commit
66b70e69
authored
5 years ago
by
shirenn
🌊
Browse files
Options
Downloads
Patches
Plain Diff
Add transaction history list on the user
parent
a456468a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Transaction history
Pipeline
#7662
passed with stage
Stage: test
in 3 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/member/views.py
+10
-1
10 additions, 1 deletion
apps/member/views.py
templates/member/profile_detail.html
+3
-1
3 additions, 1 deletion
templates/member/profile_detail.html
with
13 additions
and
2 deletions
apps/member/views.py
+
10
−
1
View file @
66b70e69
...
...
@@ -9,9 +9,11 @@ from django.views.generic import CreateView, ListView, DetailView
from
django.http
import
HttpResponseRedirect
from
django.contrib.auth.forms
import
UserCreationForm
from
django.urls
import
reverse_lazy
from
django.db.models
import
Q
from
.models
import
Profile
,
Club
from
.forms
import
ProfileForm
,
ClubForm
from
note.models.transactions
import
Transaction
class
UserCreateView
(
CreateView
):
"""
...
...
@@ -39,9 +41,16 @@ class UserCreateView(CreateView):
return
super
().
form_valid
(
form
)
class
UserDetailView
(
LoginRequiredMixin
,
DetailView
):
model
=
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
return
context
class
ClubCreateView
(
LoginRequiredMixin
,
CreateView
):
...
...
This diff is collapsed.
Click to expand it.
templates/member/profile_detail.html
+
3
−
1
View file @
66b70e69
{% extends "base.html" %}
{% load i18n static pretty_money %}
{% load i18n static pretty_money
django_tables2
%}
{% block content %}
<h3>
Compte n° {{ object.pk }}
</h3>
...
...
@@ -24,4 +24,6 @@
</dl>
<a
href=
"{% url "
password_change
"
%}"
>
{% trans 'Change password' %}
</a>
{% render_table history_list %}
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment