[ZPT] response.setHeader() best practice

Harry Wilkinson harryw@nipltd.com
Wed, 3 Apr 2002 15:03:55 +0100


On Wednesday 03 April 2002 2:34 pm, Florent Guillaume wrote:
> seb bacon  <seb@jamkit.com> wrote:
> > Could anyone point me to a nicer way of doing:
> >   <span tal:content="nocall:python:response.setHeader('blah')"></span>
> > ...using 'content' feels like an abuse of the attribute in this context.
>
> Not that nicer, but I use:
>
> <tal:block define="dummy python:response.setHeader('blah')" />
>
>
> Florent


This seems out of place in a page template to me.  My impression of the 
'correct' way to use page templates was only to present data acquired from 
lower layers, and leave the function calls that are used as procedures (ie 
not using the return value as part of the presentation of the page) to Python 
scripts.

Perhaps that's incorrect, or just unnecessarily purist.  Still, it doesn't 
seem to me like the kind of thing that ought to be in a page template.

What do you think?