"""This module holds the django admin models for the ``documents`` app."""

from django.contrib import admin

from .models import (
    BackgroundExecution,
    Document,
    Note,
)


class DocumentAdmin(admin.ModelAdmin):
    """Django admin model for the ``Document`` model."""

    list_display = (
        'id', 'name', 'trainer_document_file', 'training',
        'sort_order',
    )
    list_editable = ('sort_order',)
    list_filter = ('training',)


class BackgroundExecutionAdmin(admin.ModelAdmin):
    """Django admin model for the ``BackgroundExecution`` model."""

    list_display = ('action', 'begin_date', 'end_date')


admin.site.register(BackgroundExecution, BackgroundExecutionAdmin)
admin.site.register(Document, DocumentAdmin)
admin.site.register(Note)
