[Zope] Calling a dtml method from a product

Geoff Armstrong geofstro@monaco.mc
Thu, 4 Apr 2002 15:45:29 +0200


At 11:03 +0100 4/4/02, hans wrote:

I managed to solve it with the following:

myResult_if_any =3D DTMLMethod.DTMLMethod.__call__(self.catalog_items2, 
REQUEST=3D'REQUEST')

Seems I was just missing the quotes around the second REQUEST. A 
simple mistake.

Also, I found the only way to get ._call_=8A to work was to use the 
following import statement at the top of the file:

from OFS import DTMLMethod

and precede ._call with DTMLMethod.DTMLMethod as above, which seems a 
bit strange; but anyway it works.

I am using Python 2.x, Zope 2.5.

Thanks again for your help.

geoff


>Geoff Armstrong wrote:
>
>>  myResult_if_any =3D DTMLMethod.DTMLMethod.__call__(self.myMethod,
>>  REQUEST=3DREQUEST)
>>
>>  But; I'm still getting the error "NameError:
>>  Error Value: global name 'REQUEST'
>
>Dont know how you got this far out.
>(Looks like Python 2.x)
>how about
>myResult =3D myMethod( None, REQUEST)
>
>-------------------------------------------------------------
>Who's got only a hammer sees the world as a nail
>hans augustin  (software developer)           hans@beehive.de
>beehive elektronische medien GmbH       http://www.beehive.de
>phone: +49 30 847-82 0                  fax: +49 30 847-82 299


-- 
http://www.imagebites.net/newsland

The most convenient news site on the net!