#NEWLINE# @ property #NEWLINE# def patch_data( self ) : #NEWLINE# #INDENT# if hasattr ( self , '_patch_data' ) : #NEWLINE# #INDENT# return self . _patch_data #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# def is_optional( field ) : #NEWLINE# #INDENT# return ( Optional in [ v . __class__ for v in field . validators ] ) #NEWLINE# #UNINDENT# def is_required( field ) : #NEWLINE# #INDENT# return ( DataRequired in [ v . __class__ for v in field . validators ] ) #NEWLINE# #UNINDENT# for ( name , f ) in six . iteritems ( self . _fields ) : #NEWLINE# #INDENT# if f . is_missing : #NEWLINE# #INDENT# if is_optional ( f ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not is_required ( f ) ) and ( f . default is None ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( f , FieldList ) and ( f . min_entries == 0 ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if isinstance ( f , FormField ) : #NEWLINE# #INDENT# data [ name ] = f . patch_data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( f , FieldList ) : #NEWLINE# #INDENT# if issubclass ( f . unbound_field . field_class , FormField ) : #NEWLINE# #INDENT# data [ name ] = [ i . patch_data for i in f . entries ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data [ name ] = [ i . data for i in f . entries ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# data [ name ] = f . data #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return data