'Convert an Organisation Name to a pe_id
- helper for import_role'

@staticmethod
def _lookup_pe(entity):

    table = current.s3db.org_organisation
    org = current.db((table.name == entity)).select(table.pe_id, limitby=(0, 1)).first()
    try:
        pe_id = org.pe_id
    except:
        current.log.warning(('import_role    cannot    find    pe_id    for    %s' % entity))
        pe_id = None
    return pe_id
