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
|
2021-05-14 22:56:46 -04:00
|
|
|
extra = 0
|
2021-05-14 22:20:49 -04:00
|
|
|
|
|
|
|
|
|
|
|
class GroupToolSubscriptionInline(admin.TabularInline):
|
|
|
|
model = GroupToolSubscription
|
2021-05-14 22:56:46 -04:00
|
|
|
extra = 0
|
2020-12-03 17:59:45 -05:00
|
|
|
|
|
|
|
|
2021-05-14 22:56:26 -04:00
|
|
|
class EventInline(admin.TabularInline):
|
|
|
|
model = Event
|
2021-05-14 22:56:46 -04:00
|
|
|
extra = 0
|
2021-05-14 22:56:26 -04:00
|
|
|
|
|
|
|
|
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:56:26 -04:00
|
|
|
inlines = [GroupTaskSubscriptionInline, EventInline]
|
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]
|
|
|
|
|
|
|
|
|
2021-05-14 22:56:26 -04:00
|
|
|
|