[Compensation] Conservation office #5

* keeps responsible data in compensation model for potential future purposes
* refactors registration_office and conservation_office to map onto KonovaCodes instead of own Organization model
* adds str_as_office property-method to KonovaCode to provide an easy way of rendering template data
* adds missing highlighting in case of missing information about registration office and conservation office
This commit is contained in:
mipel
2021-08-27 09:44:23 +02:00
parent c1aea16fba
commit 6b70ee8ba9
5 changed files with 42 additions and 11 deletions

View File

@@ -57,6 +57,13 @@ class KonovaCode(models.Model):
ret_val += " ({})".format(self.short_name)
return ret_val
@property
def str_as_office(self):
ret_val = self.long_name
if self.parent:
ret_val += ", " + self.parent.long_name
return ret_val
class KonovaCodeList(models.Model):
"""