#NEWLINE# def get_form_class( self , * args , **kwargs ) : #NEWLINE# #INDENT# '\n        Returns the form class to use in this view.\n        ' #NEWLINE# if ( not self . form_class ) : #NEWLINE# #INDENT# if ( self . model is not None ) : #NEWLINE# #INDENT# model = self . model #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hasattr ( self , 'object' ) and ( self . object is not None ) ) : #NEWLINE# #INDENT# model = self . object . __class__ #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# model = self . get_queryset ( ) . model #NEWLINE# #UNINDENT# #UNINDENT# if isinstance ( args . fields , list ) : #NEWLINE# #INDENT# self . form_class = modelform_factory ( model , fields = self . fields ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . form_class = modelform_factory ( model , exclude = self . exclude ) #NEWLINE# #UNINDENT# #UNINDENT# return self . form_class