add door_height to editor form and serializer

This commit is contained in:
Laura Klünder 2017-11-14 22:24:29 +01:00
parent 37a7119455
commit 5878381619
2 changed files with 4 additions and 3 deletions

View file

@ -164,9 +164,9 @@ class EditorFormBase(ModelForm):
def create_editor_form(editor_model):
possible_fields = ['slug', 'name', 'ordering', 'category', 'width', 'groups', 'color', 'priority', 'base_altitude',
'waytype', 'access_restriction', 'height', 'default_height', 'can_search', 'can_describe',
'outside', 'geometry', 'single', 'allow_levels', 'allow_spaces', 'allow_areas', 'allow_pois',
'altitude', 'short_label', 'left', 'top', 'right', 'bottom']
'waytype', 'access_restriction', 'height', 'default_height', 'door_height', 'outside',
'can_search', 'can_describe', 'geometry', 'single', 'altitude', 'short_label',
'allow_levels', 'allow_spaces', 'allow_areas', 'allow_pois', 'left', 'top', 'right', 'bottom']
field_names = [field.name for field in editor_model._meta.get_fields() if not field.one_to_many]
existing_fields = [name for name in possible_fields if name in field_names]

View file

@ -80,6 +80,7 @@ class Level(SpecificLocation, models.Model):
result['on_top_of'] = self.on_top_of_id
result['base_altitude'] = float(str(self.base_altitude))
result['default_height'] = float(str(self.default_height))
result['door_height'] = float(str(self.door_height))
return result
def details_display(self):