# 88 Extra biotope codes

* adds additional biotope konovaCodes to CompensationState model
* increases rpp for Autocompletion
* adds/updates translations
This commit is contained in:
2022-01-31 11:26:24 +01:00
parent d0c6449c39
commit 68eb773e43
6 changed files with 80 additions and 50 deletions

View File

@@ -114,6 +114,8 @@ class AbstractCompensation(BaseObject, GeoReferencedMixin):
biotope_type=form_data["biotope_type"],
surface=form_data["surface"],
)
state_additional_types = form_data["biotope_extra"]
state.biotope_extra_types.set(state_additional_types)
if is_before_state:
self.before_states.add(state)
else:

View File

@@ -8,7 +8,7 @@ Created on: 16.11.21
from django.db import models
from codelist.models import KonovaCode
from codelist.settings import CODELIST_BIOTOPES_ID
from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID
from compensation.managers import CompensationStateManager
from konova.models import UuidModel
@@ -26,7 +26,18 @@ class CompensationState(UuidModel):
"code_lists__in": [CODELIST_BIOTOPES_ID],
"is_selectable": True,
"is_archived": False,
}
},
related_name='+',
)
biotope_extra_types = models.ManyToManyField(
KonovaCode,
blank=True,
limit_choices_to={
"code_lists__in": [CODELIST_BIOTOPES_EXTRA_CODES_ID],
"is_selectable": True,
"is_archived": False,
},
related_name='+',
)
surface = models.FloatField()