[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Open Office templates
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] Open Office templates |
Date: |
Tue, 2 Sep 2008 12:29:27 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hi Jerzy,
> Funny, but it is easier to implement my idea of fixed data
> passed to template, than I thought.
Good ! :-) See, this is why we always try to abstract away
the specifics ...
> 'gmForms.replace_placeholders' references data for a
> placeholder as a handler's property. Exactly the same syntax
> is used to get data from a dictionary {}.
>
> So I can simply do:
>
> placeholders_data = {
> 'operation_diagnosis': node_data['operation_diagnosis'],
> 'lastname':
> self.__patient.get_active_name()['lastnames'],
> 'firstname':
> self.__patient.get_active_name()['firstnames']
> }
> doc.replace_placeholders(handler = placeholders_data)
>
> Works like a charm :-)
However, you ain't passing "fixed data" ;-) although you
don't know that ... The get_active_name() stuff isn't
immutable ...
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346