def pr_remove_from_role(role_id, pe_id):
 atable = current.s3db.pr_affiliation
 query = ((atable.role_id == role_id) & (atable.pe_id == pe_id))
 affiliation = current.db(query).select(atable.id, limitby=(0, 1)).first()
 if (affiliation is not None):
  deleted_fk = {'role_id': role_id, 'pe_id': pe_id}
  data = {'deleted': True, 'role_id': None, 'pe_id': None, 'deleted_fk': json.dumps(deleted_fk)}
  affiliation.update_record(**data)
  pr_rebuild_path(pe_id, clear=True)
 return

def pr_remove_from_role ( role_id , pe_id ) : atable = current . s3db . pr_affiliation query = ( ( atable . role_id == role_id ) & ( atable . pe_id == pe_id ) ) affiliation = current . db ( query ) . select ( atable . id , limitby = ( 0 , 1 ) ) . first ( ) if ( affiliation is not None ) : deleted_fk = { 'role_id' : role_id , 'pe_id' : pe_id } data = { 'deleted' : True , 'role_id' : None , 'pe_id' : None , 'deleted_fk' : json . dumps ( deleted_fk ) } affiliation . update_record ( ** data ) pr_rebuild_path ( pe_id , clear = True ) return
back-end method to remove a person entity from a role .