Again this is a pretty big departure from the previous builds with
respect to the Response object.  I've done some quick preliminary
testing, and at least between version 9.4 and RC2 my controllers
(simple hello world stuff) were able to still use the Response object
directly.  Is this going to remain the case? Or should I migrate all
my projects over to use the new methodology of simply returning a
string? Or is direct use of the Response going to be phased out? Also
it appears that although response is globally available it is not a
global Response object, each action gets its own Response object is
that correct?
Jose

On Jul 15, 11:28 am, Ben Bangert <[EMAIL PROTECTED]> wrote:
> On Jul 15, 2007, at 10:25 AM, voltron wrote:
>
> > That worked, the project starts now. Is there some documentation
> > somewhere that I can read about how things are to done with this new
> > version? For example:
>
> > 1. Using SAContext with 0.96
>
> The latest SAContext works fine, and I believe 0.2.1 also worked ok.
>
> > 2. using the Global config object
>
> Instead of looking for app_config['something'], or using the CONFIG
> ['somekey'] from paste.deploy, you can just use:
> from pylons import config
>
> sadburi = config['sqlalchemy.dburi']
>
> This works whether your application is answering a response, and it
> works as soon as you load your WSGI app (ie, in a shell script). So
> your config info is in the same place in either case (it wasn't
> before 0.9.6).
>
> > 3. Using the Global response object
>
> There's now a pylons.response global object. Just add headers or
> cookies, or change the content type of it, and have your controller
> return a string. So instead of:
> return render_response('/some/template.html')
>
> It's just:
> return render('/some/template.html')
>
> The headers and cookies from the global response object will be sent
> out. This means you can also write functions elsewhere that use the
> response global to set headers and they'll *just work*, rather than
> having to try and pass the Response object around to add things to
> the response.
>
> > 4. How to use HTTPExceptions in a controller
>
> Same as before, just abort(404) or how you were doing it before. If
> its a 3XX status code, cookies will still be retained from the global
> response object as well.
>
> Cheers,
> Ben
>
>  smime.p7s
> 3KDownload


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
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