Hi,

adding a new option to trytond used by module code seems to be an easy
task with Tryton. E.g. just add and set the option 'myoption' in
trytond.conf. After restarting trytond the option is accessible from
the module code like this::

    from trytond.config import CONFIG
    MYOPTION = CONFIG.get('myoption', <default>)

It just reads the option from the CONFIG dict and puts it into a
constant which is accessible from the module code.

But I ask me, if it is the preferable way to introduce and handle
options and their default values from a module.

Is it e.g. a better/modular/generical way to extend the self.options in
the ConfigManager class[1] to handle the defaults of the module?

Ideas?

TIA and regards
Udo

[1] http://hg.tryton.org/trytond/file/b7fde303acd4/trytond/config.py#l38
-- 
_____________________________
virtual things
Preisler & Spallek GbR
München - Aachen

Windeckstr. 77
81375 München
Tel: +49 (89) 710 481 55
Fax: +49 (89) 710 481 56

[email protected]
http://www.virtual-things.biz

Reply via email to