from django.contrib import admin
from admin_ordering.admin import OrderableAdmin
from .models import *

# Register your models here.


@admin.register(Member)
class MemberModelAdmin(OrderableAdmin, admin.ModelAdmin):
    list_display = ['__str__', 'ordering']
    list_editable = ['ordering']
    ordering_field_hide_input = True
    exclude = ['ordering']


class OrderableModelAdmin(OrderableAdmin, admin.ModelAdmin):
    list_display = ['title', 'year', 'ordering']
    list_editable = ['ordering']
    ordering_field_hide_input = True
    exclude = ['ordering']


@admin.register(Announcement)
class AnnouncementModelAdmin(OrderableModelAdmin):
    list_display = ['title', 'ordering']


@admin.register(Protocol)
class ProtocolModelAdmin(OrderableModelAdmin):
    pass


@admin.register(Regulation)
class RegulationModelAdmin(OrderableModelAdmin):
    list_display = ['title', 'ordering']
