Hi all, and thanks for your replies. It's nice to know there's a lot
of dedicated uhm... "Pyramidos"(?) out there :)
I've read the documentation several times, but when you do something
with an external application it doesn't seem to behave the way you
would expect it. And it doesn't matter if you use the global or the
local registry. (It will always work when you use Pyramids registry,
so that's not the problem)
Check this out:
During configuration stage:
config = Configurator(settings=settings)
config.hook_zca()
config.include('pyramid_zcml')
config.load_zcml('voteit.core:configure.zcml') #contains workflow ZCML
stuff for repoze.workflow
In repoze.workflow.zcml.register_workflow (that registers the
workflows) I just added a statement that prints the result of the
zope.component.getSiteManager method.
This is what happends, according to my understanding (please correct
me if I'm wrong):
- config.hook_zca sets up Pyramids get_current_registry as hook for
zope.component.getSiteManager - that isn't committed/activated since
config.end() isn't run
- When i include the workflow, it's set up in the registry name
'global' (which is not the same as the global site manager which is
called 'base', as far as i can see)
- When configuration is done, config.end() commits the configuration
changes, and hooks get_current_registry from Pyramid as the method to
use for getSiteManager.
This has the effect that all methods, including repoze.workflow now
use the local registry. (In my case named the same as the app,
'voteit.core')
This also means that all configuration that was loaded before
config.end() was run exists in a registry that no code will ever use.
Am I missing something here? If this is the case, it would never be
possible to add any regular zope apps to pyramid during the config-
stage. Is there any way around this?
(Note: If i register the global registry as manager, the same problem
will occur since that change will be committed when config.end() is run)
Cheers,
Robin
12 jun 2011 kl. 02.55 skrev Chris McDonough:
config.hook_zca() works too without requiring using the global
registry:
<http://docs.pylonsproject.org/projects/pyramid/1.0/narr/zca.html#enabling-the-zca-global-api-by-using-hook-zca
>
- C
--
Betahaus
gsm: +46 70-333 00 10
web: http://www.betahaus.net
--
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.