#NEWLINE# def get_formset( self , request , obj = None , **kwargs ) : #NEWLINE# #INDENT# if ( 'fields' in kwargs ) : #NEWLINE# #INDENT# fields = kwargs . pop ( 'fields' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fields = flatten_fieldsets ( self . get_fieldsets ( request , obj ) ) #NEWLINE# #UNINDENT# 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 ( request , obj ) ) #NEWLINE# if ( ( self . exclude is None ) and hasattr ( self . form , '_meta' ) and kwargs . 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 ( request , obj ) ) #NEWLINE# defaults = { #NEWLINE# #INDENT# 'ct_field' : self . ct_field , #NEWLINE# 'fk_field' : self . ct_fk_field , #NEWLINE# 'form' : self . form , #NEWLINE# 'formfield_callback' : partial ( self . formfield_for_dbfield , request = request ) , #NEWLINE# 'formset' : self . formset , #NEWLINE# 'extra' : self . get_extra ( request , obj ) , #NEWLINE# 'can_delete' : can_delete , #NEWLINE# 'can_order' : False , #NEWLINE# 'fields' : fields , #NEWLINE# 'min_num' : self . get_min_num ( request , obj ) , #NEWLINE# 'max_num' : self . get_max_num ( request , obj ) , #NEWLINE# 'exclude' : exclude , #NEWLINE# #UNINDENT# } #NEWLINE# defaults . update ( kwargs ) #NEWLINE# if ( ( defaults [ 'fields' ] is None ) and ( not modelform_defines_fields ( defaults [ 'form' ] ) ) ) : #NEWLINE# #INDENT# defaults [ 'fields' ] = ALL_FIELDS #NEWLINE# #UNINDENT# return generic_inlineformset_factory ( self . model , ** defaults )