Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Wiki
Code
Merge requests
5
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
4dead7ed
Commit
4dead7ed
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
improve transaction template management
parent
c10f0a21
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/note/models/transactions.py
+4
-0
4 additions, 0 deletions
apps/note/models/transactions.py
apps/note/urls.py
+1
-1
1 addition, 1 deletion
apps/note/urls.py
apps/note/views.py
+5
-2
5 additions, 2 deletions
apps/note/views.py
with
10 additions
and
3 deletions
apps/note/models/transactions.py
+
4
−
0
View file @
4dead7ed
...
...
@@ -5,6 +5,7 @@
from
django.db
import
models
from
django.utils
import
timezone
from
django.utils.translation
import
gettext_lazy
as
_
from
django.urls
import
reverse
from
.notes
import
Note
,
NoteClub
...
...
@@ -37,6 +38,9 @@ class TransactionTemplate(models.Model):
verbose_name
=
_
(
"
transaction template
"
)
verbose_name_plural
=
_
(
"
transaction templates
"
)
def
get_absolute_url
(
self
):
return
reverse
(
'
note:template_update
'
,
args
=
(
self
.
pk
,))
class
Transaction
(
models
.
Model
):
source
=
models
.
ForeignKey
(
...
...
This diff is collapsed.
Click to expand it.
apps/note/urls.py
+
1
−
1
View file @
4dead7ed
...
...
@@ -10,6 +10,6 @@ app_name = 'note'
urlpatterns
=
[
path
(
'
transfer/
'
,
views
.
TransactionCreate
.
as_view
(),
name
=
'
transfer
'
),
path
(
'
buttons/create/
'
,
views
.
TransactionTemplateCreateView
.
as_view
(),
name
=
'
template_create
'
),
path
(
'
buttons/
detail
/<int:pk>/
'
,
views
.
TransactionTemplate
Detail
View
.
as_view
(),
name
=
'
template_
detail
'
),
path
(
'
buttons/
update
/<int:pk>/
'
,
views
.
TransactionTemplate
Update
View
.
as_view
(),
name
=
'
template_
update
'
),
path
(
'
buttons/
'
,
views
.
TransactionTemplateListView
.
as_view
(),
name
=
'
template_list
'
)
]
This diff is collapsed.
Click to expand it.
apps/note/views.py
+
5
−
2
View file @
4dead7ed
...
...
@@ -4,7 +4,7 @@
from
django.contrib.auth.mixins
import
LoginRequiredMixin
from
django.utils.translation
import
gettext_lazy
as
_
from
django.views.generic
import
CreateView
,
ListView
,
DetailView
from
django.views.generic
import
CreateView
,
ListView
,
DetailView
,
UpdateView
from
.models
import
Transaction
,
TransactionTemplate
from
.forms
import
TransactionTemplateForm
...
...
@@ -33,13 +33,16 @@ class TransactionTemplateCreateView(LoginRequiredMixin,CreateView):
"""
model
=
TransactionTemplate
form_class
=
TransactionTemplateForm
class
TransactionTemplateListView
(
LoginRequiredMixin
,
ListView
):
"""
List TransactionsTemplates
"""
model
=
TransactionTemplate
form_class
=
TransactionTemplateForm
class
TransactionTemplateDetailView
(
LoginRequiredMixin
,
DetailView
):
class
TransactionTemplateUpdateView
(
LoginRequiredMixin
,
UpdateView
):
"""
"""
model
=
TransactionTemplate
form_class
=
TransactionTemplateForm
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