django_builder icon indicating copy to clipboard operation
django_builder copied to clipboard

Field Order

Open dgleba opened this issue 4 years ago • 8 comments

Is there a way to re-order fields in the model when using https://djangobuilder.io/#/project/FJsbPtioNSAqK2SwRXIv ?

dgleba avatar Sep 12 '20 20:09 dgleba

Hi @dgleba

Thanks for the feedback, do you mean the order of the fields in the UI, or the order in the models.py output, or both? :)

mmcardle avatar Sep 14 '20 07:09 mmcardle

I would like to reorder them in the UI and then have the output models.py follow that order. So both.

dgleba avatar Sep 14 '20 11:09 dgleba

👍 Great i will see what i can do.

mmcardle avatar Sep 14 '20 11:09 mmcardle

How about this for an idea to just get things going.

Always have one field selected/highlighted. Allow the user to add before or after that field.

dgleba avatar Sep 14 '20 11:09 dgleba

A "drag and drop" reordering would be great.

Thanks for a great project/tool.

karbassi avatar Jan 26 '21 18:01 karbassi

I would love a reorder of the fields and also the modules

Reventlow avatar Jun 17 '21 18:06 Reventlow

Any order would be helpful. Right now it randomly changes as you go along.

Even pinning it to the original order would be helpful. Would that require adding an integer column and auto-filling it as entries are made?

dgleba avatar Oct 28 '23 19:10 dgleba

There was a bug in the ordering logic, it should be fixed now. The ordering should be:

  1. Models with no parents (ordered lexicographically)
  2. Models with parents (ordered lexicographically)

This should reduce the risk of parent models appearing after child models

mmcardle avatar Oct 29 '23 19:10 mmcardle