On Jun 4, 9:29 am, Paweł Stradomski <[email protected]> wrote:
> W liście Wyatt Baldwin z dnia czwartek 04 czerwca 2009:
>
> > What I'm trying to do is a subrequest, based on the original
> > request:
>
> >     req = request.copy()
> >     # ...modify req.environ here, with a different PATH_INFO, say...
> >     response = req.get_response(request.environ['wsgi.root_app'])  #
> > root app gets __call__'ed here with new environ
> >     return json.loads(response.body)
>
> I think it's a bad idea. The second request would run in the same thread

Would it?

> stamping over threadlocals (somebody knowing more about StackedObjectProxy
> would know if this is a problem in pylons). Anyway, I don't think there is a
> need for subrequest here -- can't you just get the data you need by simply
> calling some function? Move the code from controller to some common module if
> needed.

My root app is created via Paste config--not directly in my code.
Otherwise, I would do this, or I'd save a reference to the root app in
my middleware setup.
--~--~---------~--~----~------------~-------~--~----~
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