I have a model where I would like to make a custom admin change_form mimicking the behavior of the Add User functionality of the stock Django Admin Interface. That is, I want a two-step action where the user will first input only a device-id and then be taken to a page where he can enter information on the device. Similar to how you first enter username and password on a user and then fill in the other information on the following page. Any ideas?
Share
I finally managed to find how django does it. There is a
response_addmethod redefined inside properModelAdmin. Here is a link to it for the User model in django source: django.contrib.auth.admin.py. It looks like this:If you add this method to your
ModelAdminclass, then it should work similarly.That covers only two step save process in admin panel, but the other funcionalities like adding extra fields to the form on second step can also be digged out in the django source.