Ben Bangert 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')
wow this looks like a big change where can I do some reading up on it
and how to use it?, how exactly would we change the content-type or add
a cookie? if its global wouldn't changing the content type or adding a
cookie effect all your controllers and actions rather then just the one
your working on?
>
> 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
Thanks for the hard work Ben
Jose
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---