I'm trying to modify the default Site admin page to include an inline
model. Everything seems to be working fine except that no matter what
I try I can't get it to limit the fields displayed in the inline. When
I go to the site edit page in the admin, it shows the standard site
fields as it should, but it shows every field defined for the inline
model, not just the one I tell it to. The relevant code is below. Any
help would be greatly appreciated.
-----
# admin.py
from django.contrib import admin
from django.contrib.sites.models import Site
from django.contrib.sites.admin import SiteAdmin
from django.forms.models import inlineformset_factory
from lindt.sections.models import TopNav
admin.site.unregister(Site)
class TopNavInline(admin.StackedInline):
model = TopNav
formset = inlineformset_factory(
Site,
TopNav,
fields = ('order',)
)
extra = 0
max_num = 0
class SiteAdminMod(SiteAdmin):
inlines = [TopNavInline]
admin.site.register(Site, SiteAdminMod)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---