Jason and Joel - thank you for your suggestions.
I managed to get it to work using the suggestion below.
On Wednesday, March 27, 2013 1:29:44 PM UTC, Joel Kaiser wrote:
>
> Hi,
>
> I don't know if its a nice solution, but you can also set the content-type
> in your page template:
>
> <tal:setHeader >
> ${setattr(request.response,'content_type','text/xml')}
> </tal:setHeader>
>
> Joel
>
>
> 2013/3/27 Jason <[email protected] <javascript:>>
>
>>
>>
>> On Wednesday, March 27, 2013 5:22:36 AM UTC-4, Tjelvar wrote:
>>>
>>> Any suggestions on how one can modify the content-type of a response
>>> when using multiple @view_config decorators on the same view?
>>>
>>> E.g.
>>>
>>> @view_config(accept='text/**html', renderer='html.pt', ...)
>>> @view_config(accept='text/xml'**, renderer='xml.pt', ...)
>>> @view_config(accept='**application/json' renderer='json')
>>> def aview(request):
>>> return {'a':1]
>>>
>>>
>>> Hi Tjelvar,
>> Would you be able to use an event subscriber (BeforeRender?) that would
>> change the content-type of the response?
>> I do this for an application, but I am using a matchdict parameter to
>> determine the response content-type in the subscriber.
>>
>> --
>> Jason
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.