Flask-AppBuilder Actions
Skim the Actions section of FAB docs
from flask import flash, redirect
from flask_appbuilder.actions import action
Method of a ModelView class:
@action("myaction", "Send reminder email", "Are you sure?", "fa-email")
def send_email(self, items):
if not isinstance(items, list):
items = [items]
flash(f"{len(items)} emails sent!", "success")
return redirect(self.get_redirect())