#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:
2021-12-15 13:59:52 +01:00
parent 262f85e0e0
commit f4541abf20
12 changed files with 179 additions and 23 deletions

View File

@@ -16,12 +16,13 @@ from django.utils.translation import gettext_lazy as _
from compensation.managers import CompensationManager
from compensation.models import CompensationState, CompensationAction
from compensation.utils.quality import CompensationQualityChecker
from konova.models import BaseObject, AbstractDocument, Geometry, Deadline, generate_document_file_upload_path
from konova.models import BaseObject, AbstractDocument, Deadline, generate_document_file_upload_path, \
GeoReferencedMixin
from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE
from user.models import UserActionLogEntry
class AbstractCompensation(BaseObject):
class AbstractCompensation(BaseObject, GeoReferencedMixin):
"""
Abstract compensation model which holds basic attributes, shared by subclasses like the regular Compensation,
EMA or EcoAccount.
@@ -41,8 +42,6 @@ class AbstractCompensation(BaseObject):
deadlines = models.ManyToManyField("konova.Deadline", blank=True, related_name="+")
geometry = models.ForeignKey(Geometry, null=True, blank=True, on_delete=models.SET_NULL)
class Meta:
abstract = True