cmsmanage/tasks/admin.py

27 lines
634 B
Python
Raw Normal View History

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
@admin.register(Task)
class TaskAdmin(MarkdownxModelAdmin):
inlines = [GroupTaskSubscriptionInline]
prepopulated_fields = {"slug": ("name",)}
@admin.register(Tool)
class ToolAdmin(admin.ModelAdmin):
inlines = [GroupToolSubscriptionInline]
admin.site.register(Event)