You have some tree-like structure in your models, for example:
`class MyModel(models.Model):
parent = models.ForeignKey('self', verbose_name=u'Parent', \
null=True, blank=True, related_name='children')
name = models.CharField(u'Раздел', max_lengtch=255)
position = PositiveSmallIntegerField(u'Позиция', default=0)
class Meta:
ordering = ('position',)`
To see it as a tree in admin's object list(you also can sort items, move to another parents by drag-n-drop; and rename them) add this to admin.py:
`class MyModelAdmin(admin.ModelAdmin):
ordering = ('position',)
list_display = ('pk','name','parent','position')
raw_id_fields =('parent',)
list_per_page = 900 #we sould have all objects on one page
list_editable = ('name','position','parent')
def parent_id(self,obj):
return obj.parent and obj.parent.id or '0'
class Meta:
model = MyModel
class Media:
js = [settings.MEDIA_URL + s for s in ('lib/jquery-1.3.2.min.js',
'lib/jquery.tree.min.js',
'lib/plugins/jquery.tree.contextmenu.js',
'lib/mymodel_admin.js',)]
css = {
'all':(settings.MEDIA_URL+'css/nestedsortablewidget.css',)
}`
mymodel_admin.js is the code listed here, if you have different title field(not "name"), change var title_column in javascript, list_display and list_editable.
jstree can be obtained here: [jstree](http://www.jstree.com/)
screenshot is in [my blog](http://tabed.org/blog/2010/01/06/jstree-in-django-admin/)