def get_role(trans, id):
 id = trans.security.decode_id(id)
 role = trans.sa_session.query(trans.model.Role).get(id)
 if (not role):
  return trans.show_error_message(('Role not found for id (%s)' % str(id)))
 return role

def get_role ( trans , id ) : id = trans . security . decode_id ( id ) role = trans . sa_session . query ( trans . model . Role ) . get ( id ) if ( not role ) : return trans . show_error_message ( ( 'Role not found for id (%s)' % str ( id ) ) ) return role
retrieve a role by name .