Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort fields in form [improvement] #147

Open
josejachuf opened this issue Jul 13, 2016 · 3 comments
Open

Sort fields in form [improvement] #147

josejachuf opened this issue Jul 13, 2016 · 3 comments

Comments

@josejachuf
Copy link

You can sort the fields in the form based on model. Currently orders fields defined with Field() , but always located at the end of the fields defined with belongs_to().

Jose

@gi0baro
Copy link
Member

gi0baro commented Jul 13, 2016

@josejachuf how should I sort them? The fields in the model would have the same order of the instances, because the ones generated by the belongs_to helper will be added to the ones defined in the class, after the class is defined.

@josejachuf
Copy link
Author

@gi0baro perhaps explicitly, using a new form-helper [1].

[1] http://weppy.org/docs/0.7/dal/models#forms-helpers

@josejachuf
Copy link
Author

@gi0baro Provisionally for a particular case I solved this way (is rather ugly)

form.fields.insert(4, form.fields.pop())

Jose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants