From f43116c6351d980ff4c52b27090abeb2b6116435 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 31 Oct 2022 22:54:31 +0100 Subject: [PATCH] Add caps in path admin inline --- src/character/admin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/character/admin.py b/src/character/admin.py index d750b66..ac4dc73 100644 --- a/src/character/admin.py +++ b/src/character/admin.py @@ -18,6 +18,11 @@ class CapabilityAdmin(admin.ModelAdmin): ] +class CapabilityInline(admin.TabularInline): + model = models.Capability + fields = ["name", "rank", "limited", "spell"] + + @admin.register(models.Path) class PathAdmin(admin.ModelAdmin): list_display = ["name", "category", "related_to"] @@ -29,6 +34,7 @@ class PathAdmin(admin.ModelAdmin): ("Notes", {"fields": ["notes"]}), ("Documentation", {"fields": ["url"]}), ] + inlines = [CapabilityInline] def get_queryset(self, request): return super().get_queryset(request).select_related("profile", "race")