konova/intervention/admin.py
mipel 8cb4e1168d Intervention model refactoring
* splits Intervention model into three main components
   * Intervention (main object)
   * LegalData (holds legal dates, laws, etc.)
   * ResponsibilityData (holds organizations and handler)
   * This way data can be extended more easily in the future
* refactors admin.py and usages in templates
* introduces UuidModel as a base class for BaseResource
2021-07-30 09:30:33 +02:00

39 lines
828 B
Python

from django.contrib import admin
from intervention.models import Intervention, ResponsibilityData, LegalData
class InterventionAdmin(admin.ModelAdmin):
list_display = [
"id",
"title",
"created_on",
"deleted_on",
]
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",
]
admin.site.register(Intervention, InterventionAdmin)
admin.site.register(ResponsibilityData, ResponsibilityAdmin)
admin.site.register(LegalData, LegalAdmin)