from django.contrib import admin from markdownx.admin import MarkdownxModelAdmin from .models import Tool, Task, Event, GroupTaskSubscription, GroupToolSubscription class GroupTaskSubscriptionInline(admin.TabularInline): model = GroupTaskSubscription class GroupToolSubscriptionInline(admin.TabularInline): model = GroupToolSubscription class EventInline(admin.TabularInline): model = Event @admin.register(Task) class TaskAdmin(MarkdownxModelAdmin): inlines = [GroupTaskSubscriptionInline, EventInline] prepopulated_fields = {"slug": ("name",)} @admin.register(Tool) class ToolAdmin(admin.ModelAdmin): inlines = [GroupToolSubscriptionInline]