On Aug 4, 2007, at 1:00 AM, Dan Korostelev wrote:
> It's not a "mimetype", it's a "Content-Type" header. And in 0.9.6
> you should use global "response" object.
>
> Like this:
>
> response.headers['Content-Type'] = 'application/xhtml+xml'
> return render('login.mako')
>
> On 8/4/07, Alagu Madhu <[EMAIL PROTECTED]> wrote:
> Hi
>
>
> I am using Pylons 0.9.6rc2 and mako-0.1.8-py2.5.egg.
>
>
> I'm getting error in Pylons 0.9.6rc2..
> return Response(render('login.mak'), mimetype='application/xhtml+xml')
>
Right, Alagu is expecting:
response.mimetype = 'mime/type'
to work, and it doesn't. Which is definitely a change from the
Response constructor accepting mimetype. Currently you have to
manually set your content-type header.
This could be done via a .mimetype property on Response if we want.
Another thing to consider is the response also has a charset value,
if we add a .mimetype property, would that become a property too?
I.e., with a default charset of utf-8:
repsonse.mimetype = 'text/html'
-> makes response.headers['Content-Type'] = 'text/html; charset=utf-8'
response.charset = None
-> makes response.headers['Content-Type'] = 'text/html'
I sort of like that idea, because charset is always taken into
account. I think I like not having any properties, though, requiring
someone to set the full header themselves -- it's arguably cleaner.
What does everyone else think?
--
Philip Jenvey
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---