Inline Tool/Task subscriptions in the admin interface
This commit is contained in:
parent
6d1ef6ab22
commit
dc4bfcca29
@ -3,14 +3,24 @@ from markdownx.admin import MarkdownxModelAdmin
|
||||
|
||||
from .models import Tool, Task, Event, GroupTaskSubscription, GroupToolSubscription
|
||||
|
||||
admin.site.register(Tool)
|
||||
|
||||
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.site.register(GroupTaskSubscription)
|
||||
admin.site.register(GroupToolSubscription)
|
||||
@admin.register(Tool)
|
||||
class ToolAdmin(admin.ModelAdmin):
|
||||
inlines = [GroupToolSubscriptionInline]
|
||||
|
||||
|
||||
admin.site.register(Event)
|
||||
|
Loading…
Reference in New Issue
Block a user