[ZPT] response.setHeader() best practice

Florent Guillaume fg@nuxeo.com
Sun, 7 Apr 2002 14:44:04 +0000 (UTC)


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
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com