def prep(r):
    if ((not r.id) and (not r.method) and (not r.component)):
        body_id = r.get_vars.get('match', None)
        body = db((db.dvi_body.id == body_id)).select(db.dvi_body.pe_label, limitby=(0, 1)).first()
        label = ((body and body.pe_label) or ('#%s' % body_id))
        if body_id:
            query = dvi_match_query(body_id)
            r.resource.add_filter(query)
            s3.crud_strings['pr_person'].update(msg_no_match=T('No matching records found'))
    return True
def prep(r):
    if ((not r.id) and (not r.method) and (not r.component)):
        body_id = r.get_vars.get('match', None)
        body = db((db.dvi_body.id == body_id)).select(db.dvi_body.pe_label, limitby=(0, 1)).first()
        label = ((body and body.pe_label) or ('#%s' % body_id))
        if body_id:
            query = dvi_match_query(body_id)
            r.resource.add_filter(query)
            s3.crud_strings['pr_person'].update(msg_no_match=T('No matching records found'))
    return True