[Zope] Concatenation

Ben Ocean zope@thewebsons.com
Sat, 10 Nov 2001 17:42:50 -0800


At 03:34 AM 11/11/01 +0500, you wrote:
>Ben Ocean wrote:
> >
> > At 02:44 AM 11/11/01 +0500, you wrote:
> > >Ben Ocean wrote:
> > > >
> > > > Hi;
> > > > I'm trying to concatenate a <dtml-var> with a string. I have this poor
> > > attempt:
> > > >    <dtml-var expr="_.string(title_or_id.'_frame')(_,_.None)">
> > > > where *title_or_id* is (of course) the <dtml-var> and *_frame* is the
> > > > string. How should I do this?
> > >
> > >you could try
> > >
> > ><dtml-var title_or_id>_frame
> >
> > This won't do because I forgot to mention I need to concatenate this and
> > call it as a <dtml-var> (apologies to Andreas Jung).
> >
> > ><dtml-var "_.string(title_or_id)+'_frame'">
>
>sorry I meant _.str

That gives me the following:

<Python Method object at 0x8ac11b8>_frame

>for calling the method test_frame  from method test use this:
>
><h2><dtml-var title_or_id> <dtml-var document_title></h2>
><p>
>This is the <dtml-var document_id> Document
>in the <dtml-var "_[(_.str(id)+'_frame')]"> Folder.
></p>

That throws an error. Python thinks *_frame* is a variable, whereas the 
entire concatenation is the variable I need to call (your *test_frame* from 
method *test* above).

Any other ideas?
TIA,
BenO