'Get the person pe_id for a user ID
@param user_id: the user ID'

def s3_user_pe_id(self, user_id):

    table = current.s3db.pr_person_user
    row = current.db((table.user_id == user_id)).select(table.pe_id, limitby=(0, 1)).first()
    return (row.pe_id if row else None)
