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?
views:
25answers:
1
Q:
In Django, how do I mimic the two-step method of adding users through the admin for my own models?
A:
I have similiar problem. There is a Map model and Location model in my app. Location exists on map, so it has ForeignKey to the Map model. I've overriden admin/change_form.html, to display map image for the location currently being edited, and user can set location coordinates by clicking on that image (with javascript). But location has to exist in order to know what map it belongs to. So user firstly needs to choose a map for new location, save the location, then pick the coordinates and save again. That what's happening, when we create new user in django admin. Despite user selection, user form is displayed again, but with extra options. Is there a way to copy this behavior in some easy way?
Dzejkob
2010-10-31 20:39:51