'Onaccept-routine for households'

@staticmethod
def household_onaccept(form):

    formvars = form.vars
    try:
        record_id = formvars.id
    except AttributeError:
        return
    s3db = current.s3db
    htable = s3db.po_household
    ftable = s3db.po_household_followup
    left = ftable.on(((ftable.household_id == htable.id) & (ftable.deleted != True)))
    row = current.db((htable.id == record_id)).select(htable.id, htable.followup, htable.realm_entity, ftable.id, left=left, limitby=(0, 1)).first()
    if (row and row[htable.followup] and (not row[ftable.id])):
        ftable.insert(household_id=row[htable.id], realm_entity=row[htable.realm_entity])
