[Zope] Patch to avoid hypenation variables and more

Jose Soares jose@sferacarta.com
Mon, 11 Dec 2000 16:51:40 +0100


Tino Wildenhain wrote:

> Hi,
>
> anybody had time for testing? May be we could have it in the next
> zope release. Any comments, remarks? How about an alternatively or
> extra "name"-attribute wich defaults to "sequence" ?
>
> Another issue: what about an alias for <dtml-var> called something
> like: <dtml-print> <dtml-output> or <dtml-out> ? Just for the
> ones that lern zope. Since I often see the missunderstood meaning
> of <dtml-var> in such constructs like: <dtml-var "somelist[<dtml-var
> indexvar>]">
> you know what I mean? I think it would be more obvious, if the
> tag would usually be called <dtml-out> or something.
>

Yes. I vote for <dtml-print  some_var>


>
> Regards
> Tino
>
> Tino Wildenhain schrieb:
> >
> > Michel Pelletier schrieb:
> > >
> >
> > > > 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.  ;)
> > >
> > Have to find this ZUnit... ;)
> > Ok, I made some further tests and improvements. There was a mistake
> > (ok, it comes from variables spilled randomly over DT_In.py and
> > DT_InSV.py ;)
> > with the prefix. In some cases it wasnt there as supposed.
> >
> > Now all the prefix-handling should be ok. I've made an yet simple
> > test-suite, all available thru
> > http://www.zope.org/Members/tino/
> > (See "Patch for <dtml-in>" there)
> >
> > Note: the prefix prepends only the in-tags own variables. Any attribute
> > coming from the sequence is untouched. This is also true for statistic
> > variables and the magic "mapping" symbol.
> >
> > While it could easy be implemented, I think prefixing all attributes is
> > not such a good idea. If you are ilterating over database queries you
> > can rename the attributes there.
> >
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )