flask.ext.admin.actions

action(name, text, confirmation=None)[source]

Use this decorator to expose actions that span more than one entity (model, file, etc)

Parameters:
  • name – Action name
  • text – Action text.
  • confirmation – Confirmation text. If not provided, action will be executed unconditionally.
class ActionsMixin[source]

Actions mixin.

In some cases, you might work with more than one “entity” (model, file, etc) in your admin view and will want to perform actions on a group of entities simultaneously.

In this case, you can add this functionality by doing this: 1. Add this mixin to your administrative view class 2. Call init_actions in your class constructor 3. Expose actions view 4. Import actions.html library and add call library macros in your template

get_actions_list()[source]

Return a list and a dictionary of allowed actions.

handle_action(return_view=None)[source]

Handle action request.

Parameters:return_view – Name of the view to return to after the request. If not provided, will return user to the index view.
init_actions()[source]

Initialize list of actions for the current administrative view.

is_action_allowed(name)[source]

Verify if action with name is allowed.

Parameters:name – Action name

Related Topics

This Page