# django admin save/delete override

**URL:** <https://forum.djangoproject.com/t/django-admin-save-delete-override/14961>\
**Category:** The Admin\
**Created:** [July 22, 2022, 12:49pm UTC](https://forum.djangoproject.com/t/django-admin-save-delete-override/14961 "2022-07-22T12:49:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptrs32](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@ptrs32](https://forum.djangoproject.com/u/ptrs32)\
**Post date:** [July 22, 2022, 12:49pm UTC](https://forum.djangoproject.com/t/django-admin-save-delete-override/14961/1 "2022-07-22T12:49:46Z")

</div>

Hello,

As the title indicates, I’d like to be able to modify Django’s internal methods to save or delete an object from the admin.

I develop a history function and for that I would also like to increment the changes made from the administration panel.

I saw that I could modify the ModelAdmin _save\_model_ and _delete\_model_ methods in an _admin.py_ file but it doesn’t work.

I tried to add in the _admin.py_ file of my main application:

```auto
from django.contrib import admin

class ArticleAdmin(admin.ModelAdmin):
    def save_model(self, request, obj, form, change):
        obj.username = request.user
        super().save_model(request, obj, form, change)
        print("SAVE MODEL DETECTED")

    def delete_model(self, request, obj):
        super().delete_model(request, obj)
        print("DELETE MODEL DETECTED")

```

Then i tried to modify and delete objects of my database from the Django admin page but the print() don’t work…  
I’m surely doing it wrong but i can’t find help on forums so maybe someone can explain me how it works exactly ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 22, 2022, 4:42pm UTC](https://forum.djangoproject.com/t/django-admin-save-delete-override/14961/2 "2022-07-22T16:42:02Z")

</div>

Are you deleting the objects from the `ArticleAdmin` list view page (as an admin action) or the details page? (They’re two different pages.) Or are these being included in another model’s page as an inline and you’re editing them in that other page?

I’ve never done anything like this, so I have no knowledge that can directly help. I’m just trying to identify possibilities to explain why _these_ methods aren’t being executed.

I might also try adding prints before the `super` to see if `super` is going somewhere else…
