mirror of https://gitlab.crans.org/bde/nk20
Added trusts to note admin site
This commit is contained in:
parent
f3a3f07e38
commit
30d6e2c95e
|
@ -7,7 +7,7 @@ from polymorphic.admin import PolymorphicChildModelAdmin, \
|
||||||
PolymorphicChildModelFilter, PolymorphicParentModelAdmin
|
PolymorphicChildModelFilter, PolymorphicParentModelAdmin
|
||||||
from note_kfet.admin import admin_site
|
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, \
|
from .models.transactions import Transaction, TemplateCategory, TransactionTemplate, \
|
||||||
RecurrentTransaction, MembershipTransaction, SpecialTransaction
|
RecurrentTransaction, MembershipTransaction, SpecialTransaction
|
||||||
from .templatetags.pretty_money import pretty_money
|
from .templatetags.pretty_money import pretty_money
|
||||||
|
@ -21,6 +21,16 @@ class AliasInlines(admin.TabularInline):
|
||||||
model = Alias
|
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)
|
@admin.register(Note, site=admin_site)
|
||||||
class NoteAdmin(PolymorphicParentModelAdmin):
|
class NoteAdmin(PolymorphicParentModelAdmin):
|
||||||
"""
|
"""
|
||||||
|
@ -92,7 +102,7 @@ class NoteUserAdmin(PolymorphicChildModelAdmin):
|
||||||
"""
|
"""
|
||||||
Child for an user note, see NoteAdmin
|
Child for an user note, see NoteAdmin
|
||||||
"""
|
"""
|
||||||
inlines = (AliasInlines,)
|
inlines = (AliasInlines, TrustInlines)
|
||||||
|
|
||||||
# We can't change user after creation or the balance
|
# We can't change user after creation or the balance
|
||||||
readonly_fields = ('user', 'balance')
|
readonly_fields = ('user', 'balance')
|
||||||
|
|
Loading…
Reference in New Issue