On Wed, Feb 9, 2011 at 2:46 PM, Tres Seaver <tsea...@palladion.com> wrote:
> One bit I noticed: In
> https://bytebucket.org/sluggo/pyramid-docs/wiki/html/migration.html#app-globals-and-cache,
> you state::
>
>  You can also use ordinary module globals or class attributes,
>  provided you don’t run multiple instances of Pyramid applications in
>  the same process. (Pyramid does not encourage multiple applications
>  per process anyway. Instead Pyramid recommends its extensibility
>  features such as its Zope Component Architecture, which allow you to
>  write pieces of code to interfaces and plug them into a single
>  application.)
>
> Pyramid actually goes out of its way to make running multiple apps in
> the same process work:  in fact, it uses the ZCA in a way which means
> that registrations made in one app's configurator won't interfere with
> those made in another app's configurator.  Perhaps the docs need to show
> an example of such a setup, but it is quite supported.
>
> Some of us *do* write apps that expect to be extended / reconfigured via
> the ZCA registry, but Pyramid itself doesn't mandate that (or even
> document it all that well).  If such an app uses the "global" ZCA APIs,
> it won't benefit from Pyramid's segregated registries, but that is no
> different from use of any other global (module- or class-scope
> variables, etc.)

I just got back from my trip. So what's the official recommendation
for arbitrary global variables? I just wrote what I thought would be
safe. But people have their database connections and other things
they'll have to put somewhere. Should I say to put them all in the
registry? Under Settings? As module globals?

If they do want to put something into the registry, what's the syntax?
Can you just assign an attribute in 'registry'?

-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to