dynamic locations in editor

This commit is contained in:
Laura Klünder 2019-12-27 18:42:08 +01:00
parent 92be350b8c
commit c66586fcdc
6 changed files with 28 additions and 5 deletions

View file

@ -277,15 +277,17 @@ class EditorFormBase(I18nModelFormMixin, ModelForm):
def create_editor_form(editor_model):
possible_fields = ['slug', 'name', 'title', 'title_plural', 'help_text', 'icon', 'join_edges', 'up_separate',
possible_fields = ['slug', 'name', 'title', 'title_plural', 'help_text', 'position_secret',
'icon', 'join_edges', 'up_separate',
'walk', 'ordering', 'category', 'width', 'groups', 'height', 'color', 'priority', 'hierarchy',
'icon_name', 'base_altitude', 'waytype', 'access_restriction', 'default_height', 'door_height',
'outside', 'can_search', 'can_describe', 'geometry', 'single', 'altitude', 'short_label',
'origin_space', 'target_space', 'data', 'comment', 'slow_down_factor',
'origin_space', 'target_space', 'data', 'comment', 'slow_down_factor', ''
'extra_seconds', 'speed', 'description', 'speed_up', 'description_up', 'enter_description',
'level_change_description', 'base_mapdata_accessible', 'can_report_missing',
'label_settings', 'label_override', 'min_zoom', 'max_zoom', 'font_size',
'allow_levels', 'allow_spaces', 'allow_areas', 'allow_pois', 'left', 'top', 'right', 'bottom']
'allow_levels', 'allow_spaces', 'allow_areas', 'allow_pois', 'allow_dynamic_locations',
'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]