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
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
30d6e2c9
Commit
30d6e2c9
authored
1 year ago
by
nicomarg
Browse files
Options
Downloads
Patches
Plain Diff
Added trusts to note admin site
parent
f3a3f07e
No related branches found
No related tags found
1 merge request
!220
Rework of the friendships page
Pipeline
#12996
failed with stages
in 14 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/note/admin.py
+12
-2
12 additions, 2 deletions
apps/note/admin.py
with
12 additions
and
2 deletions
apps/note/admin.py
+
12
−
2
View file @
30d6e2c9
...
...
@@ -7,7 +7,7 @@ from polymorphic.admin import PolymorphicChildModelAdmin, \
PolymorphicChildModelFilter
,
PolymorphicParentModelAdmin
from
note_kfet.admin
import
admin_site
from
.models.notes
import
Alias
,
Note
,
NoteClub
,
NoteSpecial
,
NoteUser
from
.models.notes
import
Alias
,
Note
,
NoteClub
,
NoteSpecial
,
NoteUser
,
Trust
from
.models.transactions
import
Transaction
,
TemplateCategory
,
TransactionTemplate
,
\
RecurrentTransaction
,
MembershipTransaction
,
SpecialTransaction
from
.templatetags.pretty_money
import
pretty_money
...
...
@@ -21,6 +21,16 @@ class AliasInlines(admin.TabularInline):
model
=
Alias
class
TrustInlines
(
admin
.
TabularInline
):
"""
Define trusts when editing the trusting note
"""
model
=
Trust
fk_name
=
"
trusting
"
extra
=
0
readonly_fields
=
(
"
trusted
"
,)
@admin.register
(
Note
,
site
=
admin_site
)
class
NoteAdmin
(
PolymorphicParentModelAdmin
):
"""
...
...
@@ -92,7 +102,7 @@ class NoteUserAdmin(PolymorphicChildModelAdmin):
"""
Child for an user note, see NoteAdmin
"""
inlines
=
(
AliasInlines
,)
inlines
=
(
AliasInlines
,
TrustInlines
)
# We can't change user after creation or the balance
readonly_fields
=
(
'
user
'
,
'
balance
'
)
...
...
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