I've used jQuery to set up drag and drop re-ordering on the
change_list for a model. Basically I created a custom change_list
template for the model to add a submit button to the object_tools list
and to add some javascript includes. I also created my own modified
version of the
django.contrib.admin.templatetags.admin_list.result_list templatetag
to make some minor modifications to the results table so that it would
work better with jQuery UI Sortable. That all worked fine, and I'm
able to drag the items into a new order and have it properly adjust
the text of the order field. The problem comes when I hit the submit
button. It sends a jQuery .post() request to an AJAX view that I
created with a list of ids and orders in the request. I gave a Django
view that is able to properly interpret that list to grab the correct
objects and set their order fields appropriately, however if I
actually call .save() on the objects things go wrong. It will set the
order for the first few objects but then I'll get a 'too many files
open' error which requires me to restart the development server before
anything will work again.

You can see the relevant jQuery and Django code here:
https://gist.github.com/139475/10ebf385c7d5dedfddd50138f711c813446e469f

Does anyone have any ideas what might be causing this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to