mmcardle / django_builder

Django Builder Site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Field Order

dgleba opened this issue · comments

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

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? :)

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

👍 Great i will see what i can do.

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.

A "drag and drop" reordering would be great.

Thanks for a great project/tool.

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

commented

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?

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