Oct. 4th, 2010

foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
[personal profile] foxfirefey
Here's an example of making an admin page that lets people reorder the items through drag and drop. It's *fairly* genericized already--you can use the same template for multiple data types--and has the potential to be MORE generic by creating a generic view sort of thing, but I haven't done that yet.

All you need is a model that has a (Integer or PositiveInteger) field named 'order'.

The form will let you reorder the items by drag and drop and save them, and also lets you link to the usual form to add an item.

This way to the code! )

Profile

django_dev: The Django logo. (Default)
Developing with Django

April 2014

S M T W T F S
  12345
6789101112
131415161718 19
20212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags