#50 Overlaying geometries
* refactors geometry field into GeoReferencedMixin, holding more handy methods and used in all models, formerly holding the geometry field * refactors backend admin configuration, so modified, deleted and created are not editable in the backend which also skips loading of all possible choices * fixes typo in sanitize_db command * introduces GeometryConflict model, holding a link between two geometries, where one overlaps the other * adds first (WIP) messages into detail views of ema and intervention for test purposes
This commit is contained in:
@@ -7,7 +7,7 @@ Created on: 22.07.21
|
||||
"""
|
||||
from django.contrib import admin
|
||||
|
||||
from konova.models import Geometry, Deadline
|
||||
from konova.models import Geometry, Deadline, GeometryConflict
|
||||
|
||||
|
||||
class GeometryAdmin(admin.ModelAdmin):
|
||||
@@ -17,6 +17,14 @@ class GeometryAdmin(admin.ModelAdmin):
|
||||
]
|
||||
|
||||
|
||||
class GeometryConflictAdmin(admin.ModelAdmin):
|
||||
list_display = [
|
||||
"conflicting_geometry",
|
||||
"existing_geometry",
|
||||
"detected_on",
|
||||
]
|
||||
|
||||
|
||||
class AbstractDocumentAdmin(admin.ModelAdmin):
|
||||
list_display = [
|
||||
"id",
|
||||
@@ -35,5 +43,14 @@ class DeadlineAdmin(admin.ModelAdmin):
|
||||
]
|
||||
|
||||
|
||||
class BaseObjectAdmin(admin.ModelAdmin):
|
||||
readonly_fields = [
|
||||
"modified",
|
||||
"deleted",
|
||||
"created",
|
||||
]
|
||||
|
||||
|
||||
admin.site.register(Geometry, GeometryAdmin)
|
||||
admin.site.register(GeometryConflict, GeometryConflictAdmin)
|
||||
admin.site.register(Deadline, DeadlineAdmin)
|
||||
|
||||
Reference in New Issue
Block a user