20140208 (Saturday, 08 February 2014)¶
Continued to work on attestations.
Changes:
In
lino_welfare.fixtures.std
: both attestation types “Bescheinigung Ausländerbeihilfe” and “Anwesenheitsbescheinigung” now use the same body template default.body.html which tests on the type of the owner for content.A new virtual field preview
New action show_attestations next to issue_attestation
The following (internal) problem took me some time:
lino.modlib.attestations
defines a templateattestations/Attestation/Default.odt
, and Lino Welfare overrides this template. If there were a modulelino_welfare.modlib.attestations
, then things would be different, but it currently does this by defining the same template theconfig
directory of thelino_welfare
app.But the
get_installed_plugins
inlino_welare.settings
yieldslino_welfare
beforelino.modlib.attestations
, and the rule is that the *last* app wins when Lino loads templates.So Lino is right, and this was “just” a bug in application code (but a subtle one)
I finally fixed the problem by simply yielding ‘attestations’ before ‘lino_welfare’. Here is a test case which verifies the actual path:
>>> import os >>> os.environ['DJANGO_SETTINGS_MODULE'] = 'lino_welfare.settings.demo' >>> from lino.utils.config import find_config_file >>> ffn = find_config_file('Default.odt','attestations/Attestation') >>> ffn.endswith('lino_welfare/config/attestations/Attestation/Default.odt') True
(Note: the above snippet os no longer tested here, it has been copied to General overview of Lino Welfare)