On Thursday 06 September 2007, Peter M wrote:
> If I want my own custom config variable:
>
> 1) I assume I should add it to dev.cfg, is there some special syntax?
>
> 2) how I can access it's value in model.py?
>
> I was googling around but no luck. :-/
>
> It might be embarrassingly trivial but  I need help :-)
>
> Thanks


Actually it is trivial. Just add your own prefix with the variable name to the 
config file, i.e.

myapp.datadir = '/dev/null'

then you access the variable via the normal config module:

from turbogears import config

...
...

mydir=config.get('myapp.datadir')


HTH

        Uwe

--
Open Source Solutions 4U, LLC   1618 Kelly St
Phone:  +1 707 568 3056         Santa Rosa, CA 95401
Cell:   +1 650 302 2405         United States
Fax:    +1 707 568 6416

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to