save_model doesn't run on Django version 4

28 views
Skip to first unread message

Mike Kilmer

unread,
Sep 13, 2022, 12:27:54 PM9/13/22
to Django users
After having upgraded from Django 3 to 4 the save_model() method isn't running, though the form it imports does.

```
class MyCoolMapAdmin(SuperUserChangeOnlyMixIn, FilterByOwnerAdmin):
    form = MyCoolModelForm
    print("this prints on app initialization")
    
    def save_model(self, request, obj, form, change):
        print("this never runs")

class MyCoolModelForm(forms.ModelForm):

    def clean(self):
        print("this does run")
```

The `save_model` method doesn't seem to run for new or updated form submission from the "MyCool" admin page.

Thank you. 

Mike Kilmer

unread,
Sep 13, 2022, 4:59:26 PM9/13/22
to Django users
One thing I'm not sure of it, how to tell if a particular Admin page is triggering a particular Admin instance.

subin

unread,
Sep 16, 2022, 4:24:06 PM9/16/22
to django...@googlegroups.com
Kindly notify me should you need any other information.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/29eeac28-112a-4935-b0c8-62e48b6a49den%40googlegroups.com.

subin

unread,
Sep 16, 2022, 4:44:33 PM9/16/22
to django...@googlegroups.com
Thank you for contacting our 24/7 Customer Support Desk. A member of our team will respond to you within two hours. Thank you for your patience!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages