cmsmanage/tasks/admin.py

34 lines
723 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
extra = 0
class GroupToolSubscriptionInline(admin.TabularInline):
model = GroupToolSubscription
extra = 0
2021-05-14 22:56:26 -04:00
class EventInline(admin.TabularInline):
model = Event
extra = 0
2021-05-14 22:56:26 -04:00
@admin.register(Task)
class TaskAdmin(MarkdownxModelAdmin):
2021-05-14 22:56:26 -04:00
inlines = [GroupTaskSubscriptionInline, EventInline]
prepopulated_fields = {"slug": ("name",)}
@admin.register(Tool)
class ToolAdmin(admin.ModelAdmin):
inlines = [GroupToolSubscriptionInline]
2021-05-14 22:56:26 -04:00