﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16089	Adding/Removing admin Inlines on the fly	sheep2	nobody	"Inlines are very useful for creating/updating related objects at the same time.  However, sometimes you only want to create/update one of the objects instead of both. For example, when creating a User you may not want to add the associated content in a related profile model, but want to do so later.

The current implementation defines and instantiates the inlines when a admin.ModelAdmin class is instantiated, but does not allow addition/removal of more inlines anywhere(or anytime) else.

I propose two functions register_inline_instance() and unregister_inline_instance() that allow inlines to be added and removed from a model on the fly.  

Example usage:
{{{
class UserAdmin(admin.ModelAdmin):
    inlines = [StudentInline,]
    ...
    def add_view(self, request, form_url='', extra_context=None):
        self.unregister_inline_instance(StudentInline)
        return super(UserAdmin, self).add_view(request, form_url, extra_context)

    def change_view(self, request, form_url='', extra_context=None):
        self.register_inline_instance(StudentInline)
        return super(UserAdmin, self).change_view(request, form_url, extra_context)
    ...
}}}"	New feature	closed	contrib.admin	1.3	Normal	fixed			Design decision needed	1	1	1	1	0	0
