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

can't reorder a group of fields #18

Open
djay opened this issue Sep 16, 2016 · 1 comment
Open

can't reorder a group of fields #18

djay opened this issue Sep 16, 2016 · 1 comment

Comments

@djay
Copy link
Member

djay commented Sep 16, 2016

or at least I can't work out how

Lets say I have field X and I want to move f1, f2 and f3 up below it.

form.order_after(f1='X', f2='X', f3='X') will move them but it in a random order

form.order_after(f1='X', f2='f1', f3='f2') will randomly move some not others.

@djay
Copy link
Member Author

djay commented Sep 16, 2016

btw the reason is obviously the use named arguments and that they don't retain their order (see http://stackoverflow.com/questions/26748097/using-an-ordereddict-in-kwargs). There isn't a good way to fix this using the current api.

Options are

  1. support form.order_after([('f1','X'), ('f2','X'), ('f3,'X')])
  2. support form.order_after(f1='X', f2='f1', f3='f2') but so sort them according to their dependency first.
  3. form.insert_after(X=['f1','f1', 'f2'])

Can't think of any others

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

No branches or pull requests

1 participant