#NEWLINE# def get_message( self , data ) : #NEWLINE# #INDENT# with localize ( self . user . get_language_code ( ) ) : #NEWLINE# #INDENT# products = sorted ( [ ( SQLProduct . objects . get ( product_id = tx . product_id ) . code , tx . quantity ) for tx in data [ 'transactions' ] ] , key = ( lambda x : x [ 0 ] ) ) #NEWLINE# return ( DELIVERED_CONFIRM % { #NEWLINE# #INDENT# 'reply_list' : ', ' . join ( [ '{} {}' . format ( product , quantity ) for ( product , quantity ) in products ] ) , #NEWLINE# #UNINDENT# } )