'On-accept routine for dc_template:
- Create & link a Dynamic Table to use to store the Questions'

@staticmethod
def dc_template_create_onaccept(form):

    form_vars = form.vars
    try:
        template_id = form_vars.id
    except AttributeError:
        return
    mobile_data = current.deployment_settings.get_dc_mobile_data()
    table_id = current.s3db.s3_table.insert(title=form_vars.get('name'), mobile_data=mobile_data)
    db = current.db
    db.s3_field.insert(table_id=table_id, name='response_id', field_type='reference    dc_response', require_not_empty=True, component_key=True, component_alias='answer', component_tab=True, master='dc_response', settings={'component_multiple': False})
    db((db.dc_template.id == template_id)).update(table_id=table_id)
