[Product-Developers] how do I get configuration from buildout in my plone products?

Gilles Lenfant gilles.lenfant at alterway.fr
Fri May 27 10:38:24 UTC 2011


Other solution : you could use ZConfig resources and, possibly make your own config data schema, and add your configuration data in zope.conf through the "zope-conf-additional" option of buildout.

ZConfig enables to make schemaless config data in zope.conf if your configuration data can be marshalled to strings :

=== zope.conf ===
...
<product-config my-product>
foo bar
</products-config>
...
=== /zope.conf ===


=== my.products.config.py ===
from App.config import getConfiguration
...
my_config = getConfiguration().product_config['my-product']
foo = my_config['foo']
...
=== /my.products.config.py ===

This does not require additional component, all you need is OTB in Zope 2

HTH
-- 
Gilles Lenfant

Le 26 mai 2011 à 22:33, Noe Nieto a écrit :

> how do I get configuration from buildout in my plone products?
> 
> 
> 
> -- 
> ---
> Noe Nieto
> NNieto Consulting Services
> M: nnieto at noenieto.com
> W: http://noenieto.com
> T:  @tzicatl
> Li: Perfil en LinkedIn
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers



More information about the Product-Developers mailing list