[Zope] returning a dtml variable from a python expression

Lester Cram lester.cram@rah.scot.nhs.uk
Fri, 11 Jan 2002 18:43:38 +0000


A simple question
I have a variable that is returned from an sql query as <dtml-var id>
I wish to include this in a python expression to create a photofolder or =
photoimage.
When used as
<dtml-call expr=3D"manage_addProduct['Photo'].manage_addPhotoFolder(id=3D'1=
2345', title=3D'')">=20
this works.
but if used within
<dtml-in createfolder size=3D50 start=3Dquery_start>
<dtml-call expr=3D"manage_addProduct['Photo'].manage_addPhotoFolder(id =3D =
'<dtml-var id>', title=3D '' )">
</dtml-in>

I get=20
Error Type: AttributeError
Error Value: _setObject
File C:\Program Files\WebSite\lib\python\DocumentTemplate\DT_Util.py, line =
230, in eval
    (Object: manage_addProduct['Photo'].manage_addPhotoFolder(id =3D =
'<dtml-var id>', title=3D '' ))
    (Info: manage_addProduct)
  File <string>, line 2, in f
    (Object: guarded_getitem)

What is the correct way to do this?
Thanks for any help
 =20