Models define the data structures to be used by our business applications. This recipe shows how to add a basic model to a module.
We will use a simple book library example to explain this; we want a model to represent books. Each book has a name and a list of authors.
We should have a module to work with. If we follow the first recipe in this chapter, we will have an empty
my_module. We will use that for our explanation.
To add a new Model, we add a Python file describing it and then upgrade the addon module (or install it, if it was not already done). The paths used are relative to our addon module location (for example,