Commit 2d0f06f3 authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #75 from techniq/master

Maintain order of form fields when form_columns provided
parents a4d1c5d3 16b35e29
...@@ -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