[ZPT] response.setHeader() best practice

Petter Enholm Petter Enholm" <pe@snapper.no
Wed, 3 Apr 2002 16:29:15 +0200


Hi,

I totally agree with you, and this was also the reply I was working on.
The Page Templates should simply render information, all logic and
HTTP-releated stuff should be left to Python Scripts.

This will make it much easier to build alternative pages, for example
for blind users. The only thing to change is the layout, all the logic is
kept in separate scripts and the functionality of the pages
will be kept in sync when changes are made or bugs are fixed.

Best regards
Petter Enholm

----- Original Message -----
From: "Harry Wilkinson" <harryw@nipltd.com>
To: <zpt@zope.org>
Sent: Wednesday, April 03, 2002 4:03 PM
Subject: Re: [ZPT] response.setHeader() best practice


> 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?
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt