from django.contrib import admin from dbsynce.models import Documents, DocumentFile class DocumentFileInline(admin.TabularInline): model = DocumentFile extra = 1 fields = ('file',) can_delete = True @admin.register(Documents) class DocumentsAdmin(admin.ModelAdmin): list_display = ( 'id', 'check_date', 'check_level', 'expire_date', 'id_metaservice', 'requirements', 'status', 'ticket_status', 'doc_type', 'user_id', 'company_id', 'is_global', 'is_visible', 'checked_by', ) list_filter = ( 'check_date', 'expire_date', 'ticket_status', 'user_id', 'company_id', 'checked_by', ) inlines = [DocumentFileInline]