I am creating a few interfaces to assist in rudimentary tasks like bulk addition and removal of objects from the database. And I wish to arm the admin / user with a preview. eg A list of all the objects which will be deleted.
So the process (from user perspective) is something like this
- Initiate the process
- Preview the effects
- Confirm to start the actual process
- Sit back, relax and wait for completion mail.
Which of the following methods, is a good programming practice?
-
Having separate views for each of these stages and redirecting to the next one upon every error free post request.
-
A single view for the whole operation which keeps a track of the progress using some data in session variables. (currently in use)
-
Use django’s wizard form approach.
From reading your requirements it seems django’s form wizard will be better idea as it would easier to
If you are not much comfortable with wizard, having multiple views will be preferable. In that case, you may need to use
request.sessionto pass data between the views.