diff --git a/tasks/admin.py b/tasks/admin.py index 2628a1e..f2424f0 100644 --- a/tasks/admin.py +++ b/tasks/admin.py @@ -3,14 +3,24 @@ from markdownx.admin import MarkdownxModelAdmin from .models import Tool, Task, Event, GroupTaskSubscription, GroupToolSubscription -admin.site.register(Tool) + +class GroupTaskSubscriptionInline(admin.TabularInline): + model = GroupTaskSubscription + + +class GroupToolSubscriptionInline(admin.TabularInline): + model = GroupToolSubscription @admin.register(Task) class TaskAdmin(MarkdownxModelAdmin): + inlines = [GroupTaskSubscriptionInline] prepopulated_fields = {"slug": ("name",)} -admin.site.register(GroupTaskSubscription) -admin.site.register(GroupToolSubscription) +@admin.register(Tool) +class ToolAdmin(admin.ModelAdmin): + inlines = [GroupToolSubscriptionInline] + + admin.site.register(Event)