checkout - http://www.djangosnippets.org/snippets/1489/
I have used this in one project successfully - if you want drag'n'drop Otherwise just add: class Meta: ordering = ('order',) to you model - and the admin should adhere to the "order" On Nov 12, 3:16 pm, Joseph Wakeling <joseph.wakel...@gmail.com> wrote: > Hello all, > > A little query I haven't been able to find an answer to in docs or > through Google. > > I've got a little app on my site to create menus -- it's adapted > (updated to latest Django) from the menu app described at rossp.org. > > Anyway, here are the classes defined in admin.py: > > ####################################### > class MenuItemInline(admin.TabularInline): > model = MenuItem > extra = 3 > > class MenuAdmin(admin.ModelAdmin): > inlines = [MenuItemInline] > > admin.site.register(Menu,MenuAdmin) > ####################################### > > So, each Menu has several inline elements, MenuItems. > > Each MenuItem has a class variable 'order' which determines what order > the items will be listed in (lowest=first). But in the admin view, > MenuItems belonging to a menu are listed in the order they were > created. I'd like them to be sorted by MenuItem.order, but can't work > out how: I've tried setting 'ordering' elements in either MenuItem or > MenuItemInline, but it doesn't work. > > Can anyone advise? > > Thanks & best wishes, > > -- Joe -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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=.