def pr_get_path(pe_id):
 s3db = current.s3db
 atable = s3db.pr_affiliation
 rtable = s3db.pr_role
 query = (((((atable.deleted != True) & (atable.role_id == rtable.id)) & (atable.pe_id == pe_id)) & (rtable.deleted != True)) & (rtable.role_type == OU))
 roles = current.db(query).select(rtable.id, rtable.pe_id, rtable.path, rtable.role_type)
 multipath = S3MultiPath()
 append = multipath.append
 for role in roles:
  path = S3MultiPath([role.pe_id])
  if (role.path is None):
   ppath = pr_role_rebuild_path(role)
  else:
   ppath = S3MultiPath(role.path)
  path.extend(role.pe_id, ppath, cut=pe_id)
  for p in path.paths:
   append(p)
 return multipath.clean()

def pr_get_path ( pe_id ) : s3db = current . s3db atable = s3db . pr_affiliation rtable = s3db . pr_role query = ( ( ( ( ( atable . deleted != True ) & ( atable . role_id == rtable . id ) ) & ( atable . pe_id == pe_id ) ) & ( rtable . deleted != True ) ) & ( rtable . role_type == OU ) ) roles = current . db ( query ) . select ( rtable . id , rtable . pe_id , rtable . path , rtable . role_type ) multipath = S3MultiPath ( ) append = multipath . append for role in roles : path = S3MultiPath ( [ role . pe_id ] ) if ( role . path is None ) : ppath = pr_role_rebuild_path ( role ) else : ppath = S3MultiPath ( role . path ) path . extend ( role . pe_id , ppath , cut = pe_id ) for p in path . paths : append ( p ) return multipath . clean ( )
get all ancestor paths of a person entity .