[ZPT] response.setHeader() best practice

Harry Wilkinson harryw@nipltd.com
Mon, 8 Apr 2002 09:49:30 +0100


On Sunday 07 April 2002 3:44 pm, Florent Guillaume wrote:
> Harry Wilkinson  <harryw@nipltd.com> wrote:
> > On Wednesday 03 April 2002 2:34 pm, Florent Guillaume wrote:
> > > <tal:block define="dummy python:response.setHeader('blah')" />
> >
> > 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?
>
> I'd agree with you for any other kind of function call, but setHeader
> is really a special case, it's *not* part of the application logic,
> and is really related to the presentation part.
>
> Florent

This is actually what I said in my next post, dated 04/04/2002, 11:06am GMT.