#NEWLINE# def fill_default_value( attr_info , res_dict , exc_cls = ValueError , check_allow_post = True ) : #NEWLINE# #INDENT# for ( attr , attr_vals ) in six . iteritems ( attr_info ) : #NEWLINE# #INDENT# if attr_vals [ 'allow_post' ] : #NEWLINE# #INDENT# if ( ( 'default' not in res_dict ) and ( attr not in res_dict ) ) : #NEWLINE# #INDENT# msg = ( _ ( "Failed to parse request. Required attribute '%s' not specified" ) % attr ) #NEWLINE# raise exc_cls ( msg ) #NEWLINE# #UNINDENT# res_dict [ attr ] = res_dict . get ( attr , attr_vals . get ( 'default' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if check_allow_post : #NEWLINE# #INDENT# if ( attr in res_dict ) : #NEWLINE# #INDENT# msg = ( _ ( "Attribute '%s' not allowed in POST" ) % attr ) #NEWLINE# raise exc_cls ( msg )