I'm trying to exclude some fields from an admin form, but the exclude
option on the ModelForm is being ignored, as far as I can tell.  The
following is my code.  When I view the admin page in question, "Entry
Form Initialized" is printed to the command line, but all the fields,
including blog and slug, appear on the page.  Clearly I'm doing
something wrong, but I can't figure out what.

Would someone be so good as to point me in the right direction?
Thanks!

class EntryForm(forms.ModelForm):
        def __init__(self, *args, **kwargs):
                super(EntryForm, self).__init__(*args, **kwargs)
                print 'EntryForm Initialized'
        class Meta:
                model = Entry
                exclude = ('blog', 'slug')

class EntryAdmin(admin.ModelAdmin):
        form = EntryForm

admin.register(Entry, EntryAdmin)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to