konova/intervention/admin.py
mipel f64a11cb50 #18 File upload in certain folders
* refactors documents and file upload to be distributed into different subfolders, depending on the type of document (InterventionDocument, RevocationDocument, ...)
* refactors Document model into AbstractDocument
* subclasses RevocationDocument, InterventionDocument, COmpensationDocument, EmaDocument and EcoAccountDocument from AbstractDocument to provide proper functionality for each
* adds new specialized routes for each new document type (opening, removing)
* drops generic get and remove routes for documents
2021-09-01 16:24:49 +02:00

54 lines
1.2 KiB
Python

from django.contrib import admin
from intervention.models import Intervention, ResponsibilityData, LegalData, Revocation, InterventionDocument
from konova.admin import AbstractDocumentAdmin
class InterventionAdmin(admin.ModelAdmin):
list_display = [
"id",
"identifier",
"title",
"created",
"deleted",
]
class InterventionDocumentAdmin(AbstractDocumentAdmin):
pass
class ResponsibilityAdmin(admin.ModelAdmin):
list_display = [
"id",
"registration_office",
"registration_file_number",
"conservation_office",
"conservation_file_number",
"handler",
]
class LegalAdmin(admin.ModelAdmin):
list_display = [
"id",
"process_type",
"law",
"registration_date",
"binding_date",
]
class RevocationAdmin(admin.ModelAdmin):
list_display = [
"id",
"date",
"comment",
"created",
]
admin.site.register(Intervention, InterventionAdmin)
admin.site.register(ResponsibilityData, ResponsibilityAdmin)
admin.site.register(LegalData, LegalAdmin)
admin.site.register(Revocation, RevocationAdmin)
admin.site.register(InterventionDocument, InterventionDocumentAdmin)