@cache_with_key((lambda *args: display_recipient_cache_key(args[0])), timeout=((3600 * 24) * 7))
def get_display_recipient_remote_cache(recipient_id, recipient_type, recipient_type_id):
 if (recipient_type == Recipient.STREAM):
  stream = Stream.objects.get(id=recipient_type_id)
  return stream.name
 user_profile_list = UserProfile.objects.filter(subscription__recipient_id=recipient_id).select_related().order_by('email')
 return [{'email': user_profile.email, 'domain': user_profile.realm.domain, 'full_name': user_profile.full_name, 'short_name': user_profile.short_name, 'id': user_profile.id, 'is_mirror_dummy': user_profile.is_mirror_dummy} for user_profile in user_profile_list]

@ cache_with_key ( ( lambda * args : display_recipient_cache_key ( args [ 0 ] ) ) , timeout = ( ( 3600 * 24 ) * 7 ) ) def get_display_recipient_remote_cache ( recipient_id , recipient_type , recipient_type_id ) : if ( recipient_type == Recipient . STREAM ) : stream = Stream . objects . get ( id = recipient_type_id ) return stream . name user_profile_list = UserProfile . objects . filter ( subscription__recipient_id = recipient_id ) . select_related ( ) . order_by ( 'email' ) return [ { 'email' : user_profile . email , 'domain' : user_profile . realm . domain , 'full_name' : user_profile . full_name , 'short_name' : user_profile . short_name , 'id' : user_profile . id , 'is_mirror_dummy' : user_profile . is_mirror_dummy } for user_profile in user_profile_list ]
returns: an appropriate object describing the recipient .