Drag and Drop functionality


I want to develop an application that is able to do drag and drop. like drag items from one table to another . And there are several tables and each of them has a list of its own. It should physically be dropped to a different table and also be stored in a different database on the backend. Do you know how that can be accomplished? I am just scratching on the surface and seeing if it is feasible to do this in django.


The items in the tables, you mean an HTML table, correct?

Sounds like you want a jQuery plugin to help you with the visual interface. Django itself won’t let you “drag and drop”, you’ll need Javascript for that. You can set up your tables to display the info in the different models/databases, then have jQuery show the data being “moved”, which would need to trigger a view/code to actually do something with the data on the tables. That’s pretty complicated though — could there be a simpler solution than what you’re originally thinking?


Thanks Tracy for your quick response. It is a html table, or basically a list of things. This is a productivity app I am working on , where there are different lists, and I want to move a task from one list to another. I may have to learn javascript, and jquery to do that. Do you see any easier way to do this?


For the interface of dragging and dropping, yes, you’ll need to learn a bit of Javascript or jQuery — Django doesn’t touch the front-end like that, and HTML can only make static interfaces. You could not have a fancy drag and drop and maybe display in two tables with buttons for functionality, and that you can do with Django on the back-end and HTML on the front-end, but drag-and-drop is Javascript. :)