Compensation model refactoring
* splits Intervention model into main components * Compensation (main object) * ResponsibilityData (holds organizations and handler) - same as used for intervention * This way data can be extended more easily in the future * refactors deadlines
This commit is contained in:
@@ -7,7 +7,7 @@ Created on: 22.07.21
|
||||
"""
|
||||
from django.contrib import admin
|
||||
|
||||
from konova.models import Geometry, Document
|
||||
from konova.models import Geometry, Document, Deadline
|
||||
|
||||
|
||||
class GeometryAdmin(admin.ModelAdmin):
|
||||
@@ -28,5 +28,15 @@ class DocumentAdmin(admin.ModelAdmin):
|
||||
]
|
||||
|
||||
|
||||
class DeadlineAdmin(admin.ModelAdmin):
|
||||
list_display = [
|
||||
"id",
|
||||
"type",
|
||||
"date",
|
||||
"comment",
|
||||
]
|
||||
|
||||
|
||||
admin.site.register(Geometry, GeometryAdmin)
|
||||
admin.site.register(Document, DocumentAdmin)
|
||||
admin.site.register(Deadline, DeadlineAdmin)
|
||||
|
||||
@@ -55,3 +55,9 @@ class UserActionLogEntryEnum(BaseEnum):
|
||||
"""
|
||||
CHECKED = "Checked"
|
||||
RECORDED = "Recorded"
|
||||
|
||||
|
||||
class DeadlineTypeEnum(BaseEnum):
|
||||
MAINTAIN = "Maintain"
|
||||
CONTROL = "Control"
|
||||
OTHER = "Other"
|
||||
@@ -12,6 +12,7 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.gis.db.models import MultiPolygonField
|
||||
from django.db import models
|
||||
|
||||
from konova.enums import DeadlineTypeEnum
|
||||
from konova.settings import DEFAULT_SRID
|
||||
|
||||
|
||||
@@ -59,8 +60,9 @@ class Deadline(BaseResource):
|
||||
"""
|
||||
Defines a deadline, which can be used to define dates with a semantic meaning
|
||||
"""
|
||||
type = models.CharField(max_length=500, null=True, blank=True)
|
||||
type = models.CharField(max_length=255, null=True, blank=True, choices=DeadlineTypeEnum.as_choices(drop_empty_choice=True))
|
||||
date = models.DateField(null=True, blank=True)
|
||||
comment = models.CharField(max_length=1000, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.type
|
||||
|
||||
Reference in New Issue
Block a user