Flask-admin: Delete button on Edit/Detail view

Created on 9 Aug 2016  路  4Comments  路  Source: flask-admin/flask-admin

We've been moving our admin backend from an old outdated version of superadmin to the most recent version of flask-admin and started customizing a few things to make life easier on the people using our admin interface. One feature I was surprised to see missing from flask-admin was a delete button on the edit and/or detail view.

A common use case for this is: someone sends you a link straight to an edit view in the admin. You now want to delete this object. You need to navigate to the list view, then look for the object again to be able to delete it.

For now I've implemented this with a macro that fires a similar event as the delete button in the list view. I'd much rather see an implementation though that has this built into the ModelView. What are your thoughts on this?

I'd be open to overhauling my implementation and build something that can be shipped to everyone. If you agree on the usefulness of this feature.

Most helpful comment

Hello,

I also need to put the delete button on the edit/details view.

What was your solution? @lucasvo

All 4 comments

Sounds good to me, pull request is welcome.

Please also add a setting with the default set to show the button.

@mrjoes great, I'll spend some time on this in the next couple of days. I was thinking of putting the button right aligned at the bottom of the page in the same line as the save buttons but slightly offset.

Feedback on the location?

Hello,

I also need to put the delete button on the edit/details view.

What was your solution? @lucasvo

@lucasvo, were you ever able to make that PR? Would be really helpful to have this option.

Was this page helpful?
0 / 5 - 0 ratings