Wyatt Baldwin wrote:
You can't use `pylons.config` at the module level (generally
speaking), because it's only set in the context of a request.
So, you can access it from within in a model class method in the
context of a request. Another option is to call a `model.init(config)`
function from `load_environment` to set up the model.
I think that latter is preferable, since I like to keep my model
separate from any particular application environment (e.g., Web,
desktop, etc).
Oh, and an aside: the usual way to access config items is like this:
`config['sqlalchemy.url']`. You shouldn't need the `['app_conf']`.
This explains everything. Thank you!
--
Juliusz Gonera
http://juliuszgonera.com/
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.