Hi,
I created a method that generates an InlineFormset at runtime and inserts it
to a given ModelAdmin.

It works perfectly when I call my method directly on admin.py
#admin.py
admin.site.register(MyModel, MyModelAdmin)
insert_generic_plugin_inlines(MyOtherModelAdmin)

but it doesn't work when this method is called for example on a post_save
signal. Actually, in this scenario, the Inlineformset is created and
inserted to MyOtherModelAdmin.inlines, but admin interface never show it.

This is how my method performs the inline insert:
    admin.site.unregister(model)
    ix = len(model_admin.inlines)
    model_admin.inlines.insert(ix+1, inline)
    admin.site.register(model, model_admin)

Why the admin interface displays the inline formset when the method is
called during an admin.py import but not when it's called later? Any idea?
Thanks!
-- 
Marc

-- 
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