jrief/django-admin-sortable2

order starts with -1

Closed this issue · 4 comments

when drag with SortableAdminMixin in Admin List , the post request is "updatedItems:[["9", -1], ["8", 0]]" . The order field starts with "-1", which is invalid with PositiveIntegerField.

Django Version: 5.1.2

could you please give me a receipt on how to reproduce this using the provided testapp.

I use the demo in your docs. when I add books with commands as below:
image

the Admin List can not reorder, because the new order is -1, which cause 400 Bad Request

but when I use admin form page to add books , it works.

If you create the objects yourself, you then of course have to provide the initial data yourself.

If you create the objects yourself, you then of course have to provide the initial data yourself.

thanks for your reply. but it's wired when you cannot reorder the admin list items when these items has equal order value 0.