After reading how to use the zca page I've managed to register a few
utilities and adapters through
request.registry.registerUtility(...)
and
request.registry.getUtility(...)
How can you hook up the zope.component.createObject method? I did my
request.registry.registrerUtility(foo_factory, IFactory, 'Foo')
but of course creatObject by itself will go against the global repository
(and of course I get the dreaded 'could not adapt' error)
I tried the trick:
mycontext = zope.configuration.config.ConfigurationMachine()
mycontext.registry = request.registry
..and then
myfoo = createObject('Foo', context=mycontext)
But that also returns 'could not adapt'
Is my only option to do a
request.registry.getUtility(IFactory, 'Foo')()
instead of createObject?
Thanks,
Julian
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/46ff94d2-ef9e-4741-9d64-ae8e9e11cf8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.