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 BaseResourcepull/2/head
parent
5858a5fdf9
commit
e327f03893
@ -1,17 +1,38 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from intervention.models import Intervention
|
from intervention.models import Intervention, ResponsibilityData, LegalData
|
||||||
|
|
||||||
|
|
||||||
class InterventionAdmin(admin.ModelAdmin):
|
class InterventionAdmin(admin.ModelAdmin):
|
||||||
list_display = [
|
list_display = [
|
||||||
"id",
|
"id",
|
||||||
"title",
|
"title",
|
||||||
"process_type",
|
|
||||||
"handler",
|
|
||||||
"created_on",
|
"created_on",
|
||||||
"deleted_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(Intervention, InterventionAdmin)
|
||||||
|
admin.site.register(ResponsibilityData, ResponsibilityAdmin)
|
||||||
|
admin.site.register(LegalData, LegalAdmin)
|
||||||
|
Loading…
Reference in New Issue