unfoldadmin / django-unfold

Modern Django admin theme for seamless interface development
https://unfoldadmin.com
MIT License
1.94k stars 188 forks source link

Default on Weights should be incrementing #877

Open dickermoshe opened 6 days ago

dickermoshe commented 6 days ago

Do you have any examples?

image

New items automatedly have the next weight assigned

Is it a third party application feature request?

No

In case of third party application, when it was updated last time?

N/A

Describe your feature request

It's quite common that you would want to enforce that every model a a unique weight. I've marked my weight column as unique, but new items are not assigned the next weight class, they just default to zero. I would be awesome if something like the above autofiled the weights (under the hood too, if hide_ordering_field = True) and would add it to the end.

dickermoshe commented 6 days ago

A workaround for duplicate wights is to filter on an datetime column which is set by creation date