#NEWLINE# def construct( self , **kwargs ) : #NEWLINE# #INDENT# if isinstance ( self . cls , six . string_types ) : #NEWLINE# #INDENT# cls_type = load_class_from_string ( self . cls ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cls_type = self . cls #NEWLINE# #UNINDENT# f_kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , val ) in six . iteritems ( self . options ) : #NEWLINE# #INDENT# f_kwargs [ key ] = val [ 1 ] #NEWLINE# #UNINDENT# f_kwargs [ 'label' ] = self . label #NEWLINE# if ( self . widget is not None ) : #NEWLINE# #INDENT# if isinstance ( self . widget , six . string_types ) : #NEWLINE# #INDENT# widget_type = load_class_from_string ( self . widget ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# widget_type = self . widget #NEWLINE# #UNINDENT# f_kwargs [ 'widget' ] = widget_type ( ** self . get_widget_attrs ( ) ) #NEWLINE# #UNINDENT# f_kwargs . update ( kwargs ) #NEWLINE# return cls_type ( ** f_kwargs )