#38 User requests

* implements 5) "Add 'Maßnahmentyp' for KOMs "
    * prepares model and form fields as mixins for easy extension to eco accounts and emas (possibly in the future?)
This commit is contained in:
2021-11-15 15:55:09 +01:00
parent 2ca0ceade4
commit ab8d5c9724
7 changed files with 188 additions and 68 deletions
+31 -1
View File
@@ -189,7 +189,37 @@ class AbstractCompensation(BaseObject):
return checker
class Compensation(AbstractCompensation):
class CEFMixin(models.Model):
""" Provides CEF flag as Mixin
"""
is_cef = models.BooleanField(
blank=True,
null=True,
default=False,
help_text="Flag if compensation is a 'CEF-Maßnahme'"
)
class Meta:
abstract = True
class CoherenceMixin(models.Model):
""" Provides coherence keeping flag as Mixin
"""
is_coherence_keeping = models.BooleanField(
blank=True,
null=True,
default=False,
help_text="Flag if compensation is a 'Kohärenzsicherung'"
)
class Meta:
abstract = True
class Compensation(AbstractCompensation, CEFMixin, CoherenceMixin):
"""
Regular compensation, linked to an intervention
"""