Vlad, it sounds like you might want to learn about Zope Component
Architecture adapters. We use them extensively for situation like you're
describing, where you have some pluggable component that has life outside
of pyramid ( if I'm reading you correctly ), and you want to get it hooked
cleanly into your Pyramid lifecycle. They are super powerful, behind the
scenes Pyramid views *are* multi-adapters of context and request. For me,
learning how to use the underlying ZCA made Pyramid way more powerful for
large projects. The nice thing is that the registry is available everywhere
in a pyramid app, so the ZCA makes for a fantastic central train station to
hook components to each other.

There's good material on them online, and also in the Plone and Zope books.

HTH
Iain

On Thu, Dec 1, 2011 at 10:15 AM, Vlad K. <[email protected]> wrote:

>
> Hi, thanks for your feedback.
>
> It's just a matter of the separation of concerns. The code I need it in is
> confined to the model, defined in a "pluggable" model module. It's not that
> I can't redesign the chain of calls in order to pass the request object
> around, I was just looking at feasible alternatives to the required
> refactoring if the request object was to be passed around.
>
>
> .oO V Oo.
>
>
>
> On 12/01/2011 06:31 PM, Iain Duncan wrote:
>
>> BTW, pyramid is pretty much designed so that you can eliminate all magic
>> globals and thread locals by keeping a locally passed reference to  request
>> everywhere. I'm curious where you are finding it not accessible? For us, we
>> pass it into formencode validators as part of the state variable, it's
>> already in the root factories, available to templates, and in any views.
>> Where else do you have code that needs the registry? ( curious, not saying
>> you've necessarily done something wrong )
>>
>> thanks
>> Iain
>>
>>
> --
> 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.
>
>

-- 
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.

Reply via email to