* refactors CheckableMixin and RecordableMixin into CheckableObject and RecordableObject
* adds ShareableObject for wrapping share related fields and functionality
* adds share functionality to EcoAccount and EMA, just like Intervention
This commit is contained in:
2021-10-26 15:09:30 +02:00
parent 7c7a21052a
commit c4af63cea2
11 changed files with 220 additions and 117 deletions
+2 -20
View File
@@ -7,12 +7,11 @@ from django.db.models import QuerySet
from compensation.models import AbstractCompensation
from ema.managers import EmaManager
from ema.utils.quality import EmaQualityChecker
from konova.models import AbstractDocument, generate_document_file_upload_path, RecordableMixin
from konova.models import AbstractDocument, generate_document_file_upload_path, RecordableObject, ShareableObject
from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE
from user.models import UserActionLogEntry
class Ema(AbstractCompensation, RecordableMixin):
class Ema(AbstractCompensation, ShareableObject, RecordableObject):
"""
EMA = Ersatzzahlungsmaßnahme
(compensation actions from payments)
@@ -28,23 +27,6 @@ class Ema(AbstractCompensation, RecordableMixin):
EMA therefore holds data like a compensation: actions, before-/after-states, deadlines, ...
"""
# Users having access on this object
# Not needed in regular Compensation since their access is defined by the linked intervention's access
users = models.ManyToManyField(
User,
help_text="Users having access (shared with)"
)
# Refers to "verzeichnen"
recorded = models.OneToOneField(
UserActionLogEntry,
on_delete=models.SET_NULL,
null=True,
blank=True,
help_text="Holds data on user and timestamp of this action",
related_name="+"
)
objects = EmaManager()
def __str__(self):