On Mon, 4 Dec 2000, Tino Wildenhain wrote:
Hi there,
finally I want to release my patch for the in-tag. I hope it finds its way into the source-tree. I was sick writing such ugly constructs as _[_['sequence-item']] and so on, so I patched DT_In.py and DT_InSV.py (in lib/python/DocumentTemplate) to use sequence_item as well. All hypenation variables have now a second representation with underscores instead of hypenation. I hope, some time we can drop these hypenation variables.
Or drop DTML entirely.
The second problem is if you put one in-tag into another. You have to use <dtml-let> oder REQUEST.set() with variables of the outher in-tag to be able to reference them in the inner loop. The code becomes very ugly this way. So my idea was to give the in-tag an optional argument, called "prefix" to prefix all the sequence-variables with a custom identifier. So you can write:
<dtml-in some_sequence prefix="outer_"> <dtml-in some_other_sequence> <dtml-var outer_sequence_item>:<dtml-var sequence_item> </dtml-in the inner sequence> </dtml-in the outer sequence>
What do you think about this?
It's cool. Your patches are big and therefore, naturally, are a bit worrisome to us in terms of checking them into the core. Do you have a set of test DTML scripts that verify your patch? Say, a set of scripts that verifies backwards compatibity, and a set of scripts that verifies the new functionality? I would suggest even investigating "ZUnit" and creating DTML unit tests. Then we would *really* love you. ;) -Michel