-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Updated ordering values not getting saved #160
Comments
I'm also noticing this. Same for inlines. The javascript reordering works but when I save it just reverts to the previous ordering. |
The field you're using to keep the ordering information is non-unique. Therefore it might be possible that due to some unfinished commits some values might be duplicated. First, please check in the database, if you have some duplicated values or "holes" in that field. Additionally you can always try to run Since I do not use Grapelli, could you please try with the standard admin theme and check if that error still occurs. |
Running the management command sorted the issue for me |
would have been great to see the ordering numbers beforehand. Hmm, now it's too late. |
Is there a command to show the ordering numbers beforehand? I'm going to dump my database so that I can restore it after trying this command. |
Running the reorder command did not fix this problem for me. |
@paddymul did you deactivate Grapelli? |
I disabled grappeli and re-ran reorder and there still wasn't a proper
save. What's the easiest way to inspect the values that javascript is
sending django? I want to narrow down whether this is a python or js
problem.
Thanks,
Paddy
…On Sun, Jul 23, 2017 at 10:52 AM, Jacob Rief ***@***.***> wrote:
@paddymul <https://github.com/paddymul> did you deactivate Grapelli?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#160 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACeBWeDDT5VhBVpR7xdcS2Bn0_vfOgQks5sQ3pDgaJpZM4OZZq1>
.
|
I created a small django project that reproduces this bug for me. it is based on https://github.com/fasouto/django-starter-template . |
I also experience the same problem as @paddymul does. The standard changelist_view works fine. However, the inline has the problem saving the reordered state. Even when with the reorder management command, the problem is not fixed. Also, when new objects are created after installing adminsortable2, the order field should increment on its own but the inline objects end up with 0 in the order field. |
Did you Save the parent object after reordering the inline fields? |
I think I may have a solution for this. Problem seems to be that when an inline has fields listed, the order field is not being appended to the list, so nothing is submitted on save that would indicate a change in order. Adding the order field to the field list solves this, but this could be done programmatically as well. Submitted a pull request here. |
what's wrong with the current workflow? On inlines, change the order by dragging. After that save the parent object. |
I did not work for me. The drag and drop worked fine, but when I clicked save on anything where fields were listed, it did not save the new order. I had to add the order field to the list explicitly to make it work. But this is something that can be automated by the change I made. |
@meesterguyman I just tested against that fix, it works for me too. Thanks!!! @jrief can you accept the pull request and push out a new version? |
@paddymul just merged into current master. Please retest there, then I will release a new version. |
has been fixed for version 0.6.15 |
I have an application that uses django-admin-sortable2. At some point the reordering functionality was working correctly. After a series of changes to my application, the reordering functionality is no longer working. Due to migrations and other changes it is not easy to do a git bisect to find the last working state.
As it is, the reordering renders, and inlines are draggable. When I drag an inline to a new position then click save, the database isn't updated.
I have put a pdb.set_trace on the inline model's save() function and I can see that no new value for the ordering parameter are being passed in.
I'm not sure how to debug further.
I am currently running
firefox, django 1.11.3, grapelli, django-admin-sortable2 0.6.13
I was seeing the same non working functionality when running against django 10.5, by disabling grapilli, and on django-admin-sortable2 0.6.4
What can I do to provide you with more debugging information? I realize that this isn't a particularly specific bug report.
Thanks
The text was updated successfully, but these errors were encountered: