Compensation control
* removes CompensationControl model * adds comment field to CompensationAction * adds max length of 200 for comment fields in forms * adds rendering of error messages in case of invalid form input * adds/updates translations
This commit is contained in:
+1
-12
@@ -42,17 +42,6 @@ class Payment(BaseResource):
|
||||
)
|
||||
|
||||
|
||||
class CompensationControl(BaseResource):
|
||||
"""
|
||||
Holds data on how a compensation shall be controlled
|
||||
"""
|
||||
deadline = models.ForeignKey("konova.Deadline", on_delete=models.SET_NULL, null=True, blank=True)
|
||||
type = models.CharField(max_length=500, null=True, blank=True)
|
||||
expected_result = models.CharField(max_length=500, null=True, blank=True, help_text="The expected outcome, that needs to be controlled")
|
||||
by_authority = models.ForeignKey(Organisation, null=True, blank=True, on_delete=models.SET_NULL)
|
||||
comment = models.TextField()
|
||||
|
||||
|
||||
class CompensationState(UuidModel):
|
||||
"""
|
||||
Compensations must define the state of an area before and after the compensation.
|
||||
@@ -83,7 +72,7 @@ class CompensationAction(BaseResource):
|
||||
action_type = models.CharField(max_length=500, null=True, blank=True)
|
||||
amount = models.FloatField()
|
||||
unit = models.CharField(max_length=100, null=True, blank=True, choices=UnitChoices.choices)
|
||||
control = models.ForeignKey(CompensationControl, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
comment = models.TextField(blank=True, null=True, help_text="Additional comment")
|
||||
|
||||
def __str__(self):
|
||||
return "{} | {} {}".format(self.action_type, self.amount, self.unit)
|
||||
|
||||
Reference in New Issue
Block a user