# Overriding predefined model methods not work

**URL:** <https://forum.djangoproject.com/t/overriding-predefined-model-methods-not-work/29807>\
**Category:** Using the ORM\
**Created:** [April 4, 2024, 4:44am UTC](https://forum.djangoproject.com/t/overriding-predefined-model-methods-not-work/29807 "2024-04-04T04:44:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AveLexinton](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/avelexinton/32/20371_2.png) [@AveLexinton](https://forum.djangoproject.com/u/AveLexinton)\
**Post date:** [April 4, 2024, 4:44am UTC](https://forum.djangoproject.com/t/overriding-predefined-model-methods-not-work/29807/1 "2024-04-04T04:44:56Z")

</div>

I overrided the predefined model method save() and do\_something():

```auto
from django.db import models

class Blog(models.Model):
    name = models.CharField(max_length=100)
    tagline = models.TextField()

    def save(self, *args, **kwargs):
        do_something()
        super().save(*args, **kwargs)

```

then I deleted the overriding code:

```auto
from django.db import models

class Blog(models.Model):
    name = models.CharField(max_length=100)
    tagline = models.TextField()

```

BUT the do\_something() was still invoked??  
Any idea on how to prevent do\_something() working as the default method save() does?

---

<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:** [April 4, 2024, 4:50am UTC](https://forum.djangoproject.com/t/overriding-predefined-model-methods-not-work/29807/2 "2024-04-04T04:50:31Z")

</div>

I think you’re going to need to be more specific here.

In addition to posting the complete model, please describe in detail what is happening that you’re not expecting to have happen, along with describing how you’re testing this.

---

<div class="post-metadata">

**Author:** ![AveLexinton](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/avelexinton/32/20371_2.png) [@AveLexinton](https://forum.djangoproject.com/u/AveLexinton)\
**Post date:** [April 4, 2024, 5:02am UTC](https://forum.djangoproject.com/t/overriding-predefined-model-methods-not-work/29807/3 "2024-04-04T05:02:22Z")

</div>

do\_something() was not expected to be invoked when I deleted it.  
I suspect whether django has cached the overriding version, and when I restore it to a default version, it still uses the cache? So the solution may be on how to find and delete its cache.
