Commit 16b35e29 authored by Sean Lynch's avatar Sean Lynch

Maintain order of form fields when form_columns provided

parent 6ad924a6
...@@ -270,7 +270,9 @@ def get_form(model, converter, ...@@ -270,7 +270,9 @@ def get_form(model, converter,
properties = ((p.key, p) for p in mapper.iterate_properties) properties = ((p.key, p) for p in mapper.iterate_properties)
if only: if only:
properties = (x for x in properties if x[0] in only) # Filter properties while maintaining property order in 'only' list
temp = dict(properties)
properties = ((x, temp[x]) for x in only)
elif exclude: elif exclude:
properties = (x for x in properties if x[0] not in exclude) properties = (x for x in properties if x[0] not in exclude)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment