Пример #1
0
 def form(form_type):
     return render_template(
         f"forms/{form_templates.get(form_type, 'base')}.html",
         **{
             "endpoint": f"forms/{form_type}",
             "action": form_actions.get(form_type),
             "form": form_classes[form_type](request.form),
             "form_type": form_type,
         },
     )
Пример #2
0
def form(form_type):
    kwargs = ({
        "fixed_columns": table_fixed_columns[form_type],
        "type": form_type
    } if form_type in ("configuration", "result") else {})
    return render_template(
        f"forms/{form_templates.get(form_type, 'base')}_form.html",
        **{
            "endpoint": f"form/{form_type}",
            "action": form_actions.get(form_type),
            "form": form_classes[form_type](request.form),
            "form_type": form_type,
            **kwargs,
        },
    )