Re: [Repoze-dev] how to get the response

2010-04-28 Thread Davide Moro
Il giorno mar, 27/04/2010 alle 12.31 -0400, Chris Rossi ha scritto:
 Ciao Davide,
 
 There is not a response already attached to the request, but your
 instance of HTTPFound *is* a response, so you would just set your
 cookie there:
 
   ppp = HTTPFound(location=request.application_url)
   ppp.set_cookie('fb_user', value=value, ...)
   return ppp

Thanks a lot,
it works fine!

Ciao,

davide


-- 
Davide Moro

Redomino S.r.l.
Largo Valgioie 14, 
10146 Torino Italy
Tel: +39 0117499875
http://redomino.com

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] how to get the response

2010-04-27 Thread Chris Rossi
Ciao Davide,

There is not a response already attached to the request, but your
instance of HTTPFound *is* a response, so you would just set your
cookie there:

  ppp = HTTPFound(location=request.application_url)
  ppp.set_cookie('fb_user', value=value, ...)
  return ppp

Chris


On Tue, Apr 27, 2010 at 12:28 PM, Davide Moro davide.m...@redomino.com wrote:
 Hi,
 I have a question about how to get the response from a request, how to
 set a cookie and redirect.

 Is there any working example? Something like that:
    ppp = request.get_response()
    ppp.set_cookie('fb_user', value=value, ...)


 and then redirect to the application url
    return HTTPFound(location=self.request.application_url)

 Thanks,

 davide


 --
 Davide Moro

 Redomino S.r.l.
 Largo Valgioie 14,
 10146 Torino Italy
 Tel: +39 0117499875
 http://redomino.com

 ___
 Repoze-dev mailing list
 Repoze-dev@lists.repoze.org
 http://lists.repoze.org/listinfo/repoze-dev

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev