'Onaccept-callback for dvr_case_effort:
- inherit person_id from case_activity, unless specified
in form or default
@param form: the FORM'

@staticmethod
def case_effort_onaccept(form):

    formvars = form.vars
    if ('id' in formvars):
        record_id = formvars.id
    elif hasattr(form, 'record_id'):
        record_id = form.record_id
    else:
        record_id = None
    if (not record_id):
        return
    s3db = current.s3db
    etable = s3db.dvr_case_effort
    field = etable.person_id
    if (('person_id' not in formvars) and (not field.default)):
        atable = s3db.dvr_case_activity
        query = ((etable.id == record_id) & (atable.id == etable.case_activity_id))
        row = current.db(query).select(etable.id, etable.person_id, atable.person_id, limitby=(0, 1)).first()
        if row:
            effort = row.dvr_case_effort
            activity = row.dvr_case_activity
            if (not effort.person_id):
                effort.update_record(person_id=activity.person_id)
