Custom ordering of fields inside Formalchemy Fieldset

119 Views Asked by At

We have a pretty long table where a row should be rendered using FormAlchemy. The requirement is that the 'title' column should be displayed first and all other fields should follow in alphabetical order. Is there a straight forward way to move and sort fields in FormAlchemy. I need a generic solution here....is touching the FieldSet._render_fields OrderedDict appropriate?

1

There are 1 best solutions below

0
On

Passing the include paramter to the configure function of the fieldset will allow you to set the order. Are you looking to set it programatically? If not you can do

fieldset.configure(include=[fieldset.title, fieldset.a_field, fieldset.b_field, fieldset.c_field])