#NEWLINE# def recipient_represent( id , default_label = '' ) : #NEWLINE# #INDENT# ' Simplified output as-compared to pr_pentity_represent ' #NEWLINE# output = '' #NEWLINE# table = s3db . pr_pentity #NEWLINE# pe = db ( ( table . pe_id == id ) ) . select ( table . instance_type , limitby = ( 0 , 1 ) ) . first ( ) #NEWLINE# if ( not pe ) : #NEWLINE# #INDENT# return output #NEWLINE# #UNINDENT# instance_type = pe . instance_type #NEWLINE# table = db . get ( instance_type , None ) #NEWLINE# if ( not table ) : #NEWLINE# #INDENT# return output #NEWLINE# #UNINDENT# if ( instance_type == 'pr_person' ) : #NEWLINE# #INDENT# person = db ( ( table . pe_id == id ) ) . select ( table . first_name , table . middle_name , table . last_name , limitby = ( 0 , 1 ) ) . first ( ) #NEWLINE# if person : #NEWLINE# #INDENT# output = s3_fullname ( person ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( instance_type == 'pr_group' ) : #NEWLINE# #INDENT# group = db ( ( table . pe_id == id ) ) . select ( table . name , limitby = ( 0 , 1 ) ) . first ( ) #NEWLINE# if group : #NEWLINE# #INDENT# output = group . name #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return table