mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-22 14:38:03 +01:00
Add caps in path admin inline
This commit is contained in:
parent
7b232b0280
commit
f43116c635
1 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,11 @@ class CapabilityAdmin(admin.ModelAdmin):
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class CapabilityInline(admin.TabularInline):
|
||||||
|
model = models.Capability
|
||||||
|
fields = ["name", "rank", "limited", "spell"]
|
||||||
|
|
||||||
|
|
||||||
@admin.register(models.Path)
|
@admin.register(models.Path)
|
||||||
class PathAdmin(admin.ModelAdmin):
|
class PathAdmin(admin.ModelAdmin):
|
||||||
list_display = ["name", "category", "related_to"]
|
list_display = ["name", "category", "related_to"]
|
||||||
|
@ -29,6 +34,7 @@ class PathAdmin(admin.ModelAdmin):
|
||||||
("Notes", {"fields": ["notes"]}),
|
("Notes", {"fields": ["notes"]}),
|
||||||
("Documentation", {"fields": ["url"]}),
|
("Documentation", {"fields": ["url"]}),
|
||||||
]
|
]
|
||||||
|
inlines = [CapabilityInline]
|
||||||
|
|
||||||
def get_queryset(self, request):
|
def get_queryset(self, request):
|
||||||
return super().get_queryset(request).select_related("profile", "race")
|
return super().get_queryset(request).select_related("profile", "race")
|
||||||
|
|
Loading…
Reference in a new issue