Multiple actions in lists
See original GitHub issueFor a project of mine, I need to select multiple items to carry out an action (in my case consolidate duplicate records).
I’ve started implementing a generalised format so other actions can be added by individuals (inspired by actions in Django with some implementation details cribbed from flask-peewee’s admin module).
I’ve started with delete selected. I plan on cleaning it up for more general use but wanted to open it up to feedback before I go completely down the path.
https://github.com/beyondwords/flask-admin/commit/c7a3ba94fa425610b41df8b3fd59d6128bf7a744
Please contribute any comments on architecture.
- An action is called with the
BaseModelView
sub-class,request
, andid_list
- The action must have
label
specified for the drop-down list - The action must check for permissions
is_accessible
,can_delete
etc. - The action can either return a redirect/rendered page or
None
and use a flash message to return to the list - The action can be a simple function or a class instance with
__call__
implemented
Issue Analytics
- State:
- Created 11 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
c# - Using multiple Actions in Action<object> list - Stack Overflow
Using multiple Actions in Action<object> list · 1 · How Updater. · Simply loop your elements in the list and call the delegate:...
Read more >Add multiple actions and advanced options to a cloud flow
In this procedure, you'll add an action in the middle of the flow. This action will save a file in your Dropbox, archiving...
Read more >Use list actions in Shortcuts on iPhone or iPad - Apple Support
When working with multiple items in a shortcut, use list actions to create ordered lists of data that are passed onto the next...
Read more >Two possible list designs: How to depict per-item actions?
The debate is whether to put the actions on each list item, hidden in an ellipsis icon, or at the top of the...
Read more >[List] Allow adding multiple secondary actions #31865 - GitHub
To allow both actions, we add two IconButtons to the list items (see example above). Our application is mainly used on desktop browsers,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
I pushed my changes. You can see how mass delete action was implemented for SQLA models here:
https://github.com/mrjoes/flask-admin/blob/master/flask_admin/contrib/sqlamodel/view.py#L553
So, if you want to add your custom action:
Checkboxes won’t be displayed if no actions are visible (drop down element won’t be displayed either). I also separated actions library into separate file, so file admin is now using it and can mass-delete files too.
Hope it helps.
Serge.
On Sun, Aug 19, 2012 at 6:02 AM, F. Gabriel Gosselin < notifications@github.com> wrote:
Page not found 😦, could you make it post it again please?