Compensation action

* adds compensation action to compensation detail view
* adds adding/removing logic for compensation action
* adds bootstrap style to select fields in forms
* refactors UnitEnum into UnitChoices using models.TextChoices (Django 3.x)
* adds translations
This commit is contained in:
mipel
2021-08-04 10:44:02 +02:00
parent d773c3b3d4
commit f666c3afa3
8 changed files with 333 additions and 70 deletions

View File

@@ -18,23 +18,3 @@ class BaseEnum(Enum):
empty_choice = [] if drop_empty_choice else [(None, "---")]
choices = empty_choice + [(enum.value, enum.name) for enum in cls]
return choices
class UnitEnum(BaseEnum):
"""
Predefines units for selection
"""
mm = "mm"
dm = "dm"
cm = "cm"
m = "m"
km = "km"
qmm = "qmm"
qdm = "qdm"
qcm = "qcm"
qm = "qm"
qkm = "qkm"
ha = "ha"
st = "St." # pieces