I finally managed to find how django does it. There is a response_add method overridden inside the correct ModelAdmin . Here is a link to it for the user model in the django source: django.contrib.auth.admin.py . It looks like this:
def response_add(self, request, obj, post_url_continue='../%s/'): if '_addanother' not in request.POST and '_popup' not in request.POST: request.POST['_continue'] = 1 return super(UserAdmin, self).response_add(request, obj, post_url_continue)
If you add this method to your ModelAdmin class, then it should work similarly.
This only covers the two-step save process in the admin panel, but other functions, such as adding additional fields to the form in the second step, can also be dug in the django source.
Jekob
source share