Summary
In this chapter, we learned about the different model types, such as transient and abstract models, and why these are useful for user interface wizards and mixins, respectively. Other relevant model features include Python and SQL constraints, which can be used to prevent data entry errors.
We also learned about the available field types, as well as all the attributes they support, to be able to represent the business data in the most accurate way possible. We also learned about relationships fields, and how to use them to create relationships between the different entities that are used by our applications.
After that, we saw that models are usually based on the models.Model
class, but that we can also use models.Abstract
for reusable mixin models and models.Transient
for wizards or advanced user interaction dialogs. We saw the general model attributes that are available, such as _order
for default sort order and _rec_name
for the default field to use for record representation...