[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:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user