Hi; Here is my very_simple external method. It is called sizeCalc
def sizeCalc(x,y): print x*y <<< I have imported the external python method. I call it in a script with this line: <img src="images/top" width=<dtml-var sizeCalc(1008,<dtml-var size>)> height=<dtml-var sizeCalc(82,<dtml-var size>)> alt=""> Yes, <dtml-var size> is defined. I get the following errors:
Traceback (innermost last): File /apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, line 187, in publish File /apache/ZopeInstallation/Zope_software_home/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: LockableItem) File /apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, line 171, in publish File /apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /apache/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /apache/ZopeInstallation/Zope_software_home/lib/python/OFS/DTMLDocument.py, line 199, in __call__ (Object: index_html) File /apache/ZopeInstallation/Zope_software_home/lib/python/DocumentTemplate/DT_String.py, line 546, in __call__ (Object: index_html) File /apache/ZopeInstallation/Zope_software_home/lib/python/OFS/DTMLMethod.py, line 187, in __call__ (Object: template) File /apache/ZopeInstallation/Zope_software_home/lib/python/DocumentTemplate/DT_String.py, line 546, in __call__ (Object: template) File /apache/ZopeInstallation/Zope_software_home/lib/python/DocumentTemplate/DT_Var.py, line 278, in render (Object: sizeCalc(1008,<dtml-var) KeyError: (see above) Please help me see my (no doubt very obvious) error. TIA, BenO
On Tue, Oct 23, 2001 at 05:59:22AM -0700, Ben Ocean wrote:
Hi; Here is my very_simple external method. It is called sizeCalc
Some number of errors.
def sizeCalc(x,y): print x*y
return printed
I have imported the external python method. I call it in a script with this line: <img src="images/top" width=<dtml-var sizeCalc(1008,<dtml-var size>)>
Do not use DTML inside DTML. <img src="images/top" width=<dtml-var sizeCalc(1008,size)>... Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
Ben Ocean -
Oleg Broytmann