'Clear descendant paths, also called indirectly via
ondelete-CASCADE when a role gets deleted.
@param row: the deleted Row'

@staticmethod
def pr_affiliation_ondelete(row):

    if (row and row.id):
        db = current.db
        atable = db.pr_affiliation
        query = (atable.id == row.id)
        record = db(query).select(atable.deleted_fk, limitby=(0, 1)).first()
    else:
        return
    if (record and record.deleted_fk):
        data = json.loads(record.deleted_fk)
        pe_id = data.get('pe_id')
        if pe_id:
            current.s3db.pr_rebuild_path(pe_id, clear=True)
    return
