#NEWLINE# def to_native( self , value ) : #NEWLINE# #INDENT# if ( value . value_range is not None ) : #NEWLINE# #INDENT# if ( value . value is not None ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Do not use value and value_range together' ) ) #NEWLINE# #UNINDENT# if ( value . operator is not None ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'operator should not be used with value_range' ) ) #NEWLINE# #UNINDENT# if ( not isinstance ( value . value_range , list ) ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'value_range should be a list' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if value . value_range : #NEWLINE# #INDENT# return ( [ value . element_name ] + value . value_range ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if value . operator : #NEWLINE# #INDENT# return [ value . operator , ( '$' + value . element_name ) , value . value ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# value . element_name : value . value , #NEWLINE# #UNINDENT# }