Can we edit actions present at the right side in Django admin

Viewed 36

I am currently working on a Django Application. I have used Django Jazzmin (a drop-in theme for django admin). I have customised Django admin upto a certain extent according to my needs. However, I want to edit the available actions when Admin navigates to the user model (present at the right side of screen). As you can see in the screenshot below there are only four options available which are 'Save', 'Delete', 'Save and add another' and 'Continue editing'.

django admin ss

However, I want to create one more action Fetch Data that makes an API call with current user's id as parameter and fetch the related data of the user to update existing database. Can we do this by changing admin actions? Or there is a better alternative or approach to achieve this solution?

1 Answers

After waiting for almost two days I myself found a solution to this problem. You need to extend this specific admin page's template and modify according to your need. It is also mentioned in the documentation of Django Jazzmin.

Related