[Zope] Patch to avoid hypenation variables and more

Curtis Maloney curtis@cardgate.net
Tue, 5 Dec 2000 09:34:42 +1100


On Monday 04 December 2000 17:07, 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.
>

<insert raucous applause here>
Thank you for finding the time to do what I did not have the time to. (o8

As I have said several times on this list, this is well overdue.  Hopefuly 
the '-' tags can migrate their way out of Zope the way <!--# has.

> 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?
>

I like!  I like it a lot!  This is, imho, quite an elegant solution to an 
ugly problem.

I know these two were considered 'minor' problems, and thus not given much 
attention, but they're just one more niggling problem that will no longer 
elicit the same old newbie questions to this list.

Have a better one,
	Curtis Maloney.