#88 Action/Biotope API extension

* extends the API to support serializing and deserializing of action_details and biotope_details
* renames biotope_extra_types into biotope_type_details on CompensationState model for convenience reasons and to match CompensationAction's action_type_details
This commit is contained in:
2022-01-31 14:01:02 +01:00
parent 2b33f0e23f
commit 8bc13e8c00
9 changed files with 35 additions and 20 deletions

View File

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

View File

@@ -29,7 +29,7 @@ class CompensationState(UuidModel):
},
related_name='+',
)
biotope_extra_types = models.ManyToManyField(
biotope_type_details = models.ManyToManyField(
KonovaCode,
blank=True,
limit_choices_to={