2020-12-03 12:31:39 -05:00
|
|
|
from django.contrib import admin
|
2020-12-22 15:15:43 -05:00
|
|
|
from markdownx.admin import MarkdownxModelAdmin
|
2020-12-03 12:31:39 -05:00
|
|
|
|
2020-12-17 11:47:22 -05:00
|
|
|
from .models import Tool, Task, Event, GroupTaskSubscription, GroupToolSubscription
|
2020-12-03 12:31:39 -05:00
|
|
|
|
2021-05-14 22:20:49 -04:00
|
|
|
|
|
|
|
class GroupTaskSubscriptionInline(admin.TabularInline):
|
|
|
|
model = GroupTaskSubscription
|
|
|
|
|
|
|
|
|
|
|
|
class GroupToolSubscriptionInline(admin.TabularInline):
|
|
|
|
model = GroupToolSubscription
|
2020-12-03 17:59:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Task)
|
2020-12-22 15:15:43 -05:00
|
|
|
class TaskAdmin(MarkdownxModelAdmin):
|
2021-05-14 22:20:49 -04:00
|
|
|
inlines = [GroupTaskSubscriptionInline]
|
2020-12-03 17:59:45 -05:00
|
|
|
prepopulated_fields = {"slug": ("name",)}
|
|
|
|
|
|
|
|
|
2021-05-14 22:20:49 -04:00
|
|
|
@admin.register(Tool)
|
|
|
|
class ToolAdmin(admin.ModelAdmin):
|
|
|
|
inlines = [GroupToolSubscriptionInline]
|
|
|
|
|
|
|
|
|
2020-12-03 12:31:39 -05:00
|
|
|
admin.site.register(Event)
|