#NEWLINE# def serialize_range_queries( self ) : #NEWLINE# #INDENT# s = [ ] #NEWLINE# for ( name , rel , values ) in sorted ( self . ranges ) : #NEWLINE# #INDENT# range_s = self . range_query_templates [ rel ] #NEWLINE# if values : #NEWLINE# #INDENT# values = values [ 0 ] #NEWLINE# if ( not is_iter ( values ) ) : #NEWLINE# #INDENT# values = [ values ] #NEWLINE# #UNINDENT# values = sorted ( values ) #NEWLINE# values = [ self . to_query ( v ) for v in values ] #NEWLINE# range_s = ( self . range_query_templates [ rel ] % tuple ( values ) ) #NEWLINE# #UNINDENT# s . append ( ( '%s:%s' % ( name , range_s ) ) ) #NEWLINE# #UNINDENT# return s