#NEWLINE# @ filter_hook #NEWLINE# def get_formset( self , **kwargs ) : #NEWLINE# #INDENT# 'Returns a BaseInlineFormSet class for use in admin add/change views.' #NEWLINE# if ( self . exclude is None ) : #NEWLINE# #INDENT# exclude = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# exclude = list ( self . exclude ) #NEWLINE# #UNINDENT# exclude . extend ( self . get_readonly_fields ( ) ) #NEWLINE# if ( ( self . exclude is None ) and hasattr ( self . form , '_meta' ) and self . form . _meta . exclude ) : #NEWLINE# #INDENT# exclude . extend ( self . form . _meta . exclude ) #NEWLINE# #UNINDENT# exclude = ( exclude or None ) #NEWLINE# can_delete = ( self . can_delete and self . has_delete_permission ( ) ) #NEWLINE# defaults = { #NEWLINE# #INDENT# 'form' : self . form , #NEWLINE# 'formset' : self . formset , #NEWLINE# 'fk_name' : self . fk_name , #NEWLINE# 'fields' : forms . ALL_FIELDS , #NEWLINE# 'exclude' : exclude , #NEWLINE# 'formfield_callback' : self . formfield_for_dbfield , #NEWLINE# 'extra' : self . extra , #NEWLINE# 'max_num' : self . max_num , #NEWLINE# 'can_delete' : can_delete , #NEWLINE# #UNINDENT# } #NEWLINE# defaults . update ( kwargs ) #NEWLINE# return inlineformset_factory ( self . parent_model , self . model , ** defaults )