In Chapter 7, Module Data, you saw how to add, update, and delete records from XML or CSV files. Sometimes, however, the business case is complex and it can't be solved using data files. In such cases, you can use the init hook from the manifest file to perform the operations you want.
Implementing init hooks
Getting ready
We will use the same my_library module from the previous recipe. For simplicity, in this recipe, we will just create some book records through post_init_hook.
How to do it...
In order to add the post_init_hook, follow these steps:
- Register the...