December 2018
Beginner to intermediate
404 pages
10h 14m
English
Using Python strings to build HTML will get boring very fast. QWeb templates can do a much better job. So, let's write an improved version of our Hello World web page, using a template.
QWeb templates are added through XML data files, and technically they are just a type of view, alongside form or tree views. They are even stored in the same technical Model, ir.ui.view.
As usual, data files to be loaded must be declared in the manifest file, so edit the library_website/__manifest__.py file to add the key:
'data': [ 'security/ir.model.access.csv', 'security/library_security.xml', 'views/library_member.xml', 'views/helloworld_template.xml', ],
Then, add the actual data file, views/helloworld_template.xml ...
Read now
Unlock full access