[Zope-dev] Re: [ZPT] Order of attribute execution Feature Request

Chris Withers chrisw@nipltd.com
Fri, 10 May 2002 11:53:47 +0100


Jim Penny wrote:
> 
> on the surface, to be pretty ugly.  I have said that there are three
> specific things I dislike about ZPT -- 0)  lots of things have changed
> spelling again -- request v. REQUEST, here v. context v. container v.
> this v. ? 

Yeah, there was absolutely no need for this and I did find it extremely frustrating. That
said, the whole area has always been a mess, particularly in DTML. I do, however, wish
that Script (Python)'s and ZPT could have been consistent :-((

1) infix notation that makes program scansion hard, 

You don't HAVE to use infix ;-)

<tr tal:repeat="x xes">
 <td tal:content="x/id">an ID</td>
</tr>

...can also be written as:

<tal:x repeat="x xes">
<tr>
 <td><tal:x replace="x/id"/></td>
</tr>
</tal:x>

> 2) the
> order of operations, which I think is baroque.  Six levels of precendence
> for eight statements is pretty amazing.  And it is certainly harder to
> explain/remember than "things happen in the order you specify."

*shrugs* I've done a u-turn on this. Tim's comments make it perfectly obvious why this
needs to be the case, and at least it is very well defined what order things happen in (as
Ken pointed out). My only beef is that define sometimes happens in an order that is less
helpful than it could be ;-)

<tal:x repeat="fish fishes"
       define="species fish/species">

...doesn't do what I'd like it to ;-)

> I will add a fourth nit -- I cannot see why attributes should be plural
> when every other command is singular.  Certainly it feels like attribute
> ought to be an acceptable spelling of the atttributes command!

*shrugs* this is pretty minor to be honest ;-)

> My most-missed DTML feature has not been mentioned at all -- it is not
> loop batching -- it is the dtml-else option of dtml-in -- which made it
> much easier to handle the "nothing found" case.

<tal:x define="pigs here/gimmeSomePigs">

<tal:x repeat="pig pigs">
This little piggie went to <tal:x replace="pig/location">.
</tal:x>

<tal:else condition="not:pigs">
Waaagh! No bacon!
</tal:else>

</tal:x>

> I also have not found a convention that I am comfortable with on
> handling check-boxes and radio buttons in error processing.  But I
> expect to!

Not sure what you mean, can you explain the problem a bit more?

cheers,

Chris