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