Note: I'm only mentioning the (minor) issues I had here, but overall
the experience was fairly painless. It only required a few changes and
didn't take much time at all.
I really like that `config` is passed around during initialization (I
just made a similar change in a JS code base).
One thing I don't like, though, is the recommendation to do
`app.config = config` in middleware.py. It just feels wrong to "monkey
patch" the app instance this way. For one thing, this might conflict
with a `config` property on the app instance. For another, if you
define middleware in a config file (as I do), `config` will get set on
the wrong middleware object.
My first pass at a solution is this in environment.py:
def load_environment(global_conf, app_conf):
# ...
global app_config
app_config = config
return config
I'm not sure this is the best approach (any better ideas?), but I'm
only using it in tests, and it works fine.
The only other thing that threw me off (just a little) was
`app_globals`. It was clear that `pylons.c` and `pylons.g` are gone,
but it wasn't clear that `g` is no longer available in *templates*,
partly because `c` still is and partly because the 1.0 docs (http://
pylonshq.com/docs/en/1.0/) say the `g` alias is available.
--
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.