flask_admin.helpers

get_current_view() Any | None[source]

Get current administrative view.

Forms

is_required_form_field(field: Field) bool[source]

Check if form field has DataRequired, InputRequired, or FieldListInputRequired validators.

Parameters:

field – WTForms field to check

is_form_submitted() bool[source]

Check if current method is PUT or POST

validate_form_on_submit(form: Form) bool[source]

If current method is PUT or POST, validate form and return validation status.

get_form_data() ImmutableMultiDict[str, str] | None[source]

If current method is PUT or POST, return concatenated request.form with request.files or None otherwise.

is_field_error(errors: list[Any] | tuple[Any, ...] | None) bool[source]

Check if wtforms field has error without checking its children.

Parameters:

errors – Errors list.

Jinja2 helpers

resolve_ctx(context: Context) None[source]

Resolve current Jinja2 context and store it for general consumption.

get_render_ctx() Context | None[source]

Get view template context.