Writing a wizard to guide the user
In the Using abstract models for reusable model features recipe in Chapter 4, Application Models, the models.TransientModel
base class was introduced. This class shares a lot with normal models, except that the records of transient models are periodically cleaned up in the database, hence the name transient. These are used to create wizards or dialog boxes, which are filled in the user interface by the users and are generally used to perform actions on the persistent records of the database.
Getting ready
For this recipe, we will use the my_library
module from the previous recipes. This recipe will add a new wizard. With this wizard, librarians will be able to issue multiple books at the same time.
How to do it...
Follow the given steps to add a new wizard for creating book rent records:
- Add a new transient model to the module, with the following definition:
class LibraryRentWizard(models.TransientModel): ...