from adminsortable2.admin import SortableAdminMixin, SortableInlineAdminMixin
from django.contrib import admin
from marks.models import MarkCriteria, MarkCriteriaGroup


class MarkCriteriaInline(SortableInlineAdminMixin, admin.TabularInline):  # or admin.StackedInline
    model = MarkCriteria


class MarkCriteriaGroupAdmin(SortableAdminMixin, admin.ModelAdmin):
    inlines = [MarkCriteriaInline]


admin.site.register(MarkCriteriaGroup, MarkCriteriaGroupAdmin)
