Re: [Zope] Re: Newbie - passing a list to an External Method
Josef, Thanks very much for the email. I have tried as you suggested, changing the function definition to: def run(self, fileID='mydefaultID.pdf',lines=['Error','no lines passed in']): and calling it with: <dtml-let link="sping2(fileID=fileId,lines=mylines)"> But, again I seem to get the same (or a similar) error: ===================================================================== Error Type AttributeError Error Value __getitem__ Traceback (most recent call last): File "C:\PROGRA~1\ZopeSite\lib\python\DocumentTemplate\DT_Try.py", line 149, in render_try_except result = render_blocks(self.section, md) File "C:\PROGRA~1\ZopeSite\lib\python\DocumentTemplate\DT_Let.py", line 75, in render else: d[name]=expr(md) File "C:\PROGRA~1\ZopeSite\lib\python\DocumentTemplate\DT_Util.py", line 159, in eval return eval(code, d) File "", line 2, in f File "C:\PROGRA~1\ZopeSite\lib\python\Products\ExternalMethod\ExternalMethod.py", line 205, in __call__ return apply(f,(self.aq_parent.this(),)+args,kw) File "C:\PROGRA~1\ZopeSite\Extensions\formatted-strings.py", line 29, in run for line in lines: AttributeError: __getitem__ ===================================================================== Again, if I just return lines, or fileID, before this loop, it returns the value fine. Thanks again for your help. Regards Ashley _________________________________________________________________ Surf together with new Shared Browsing http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059
Ashley Lloyd wrote at 2003-4-23 10:19 +0100:
I have tried as you suggested, changing the function definition to: def run(self, fileID='mydefaultID.pdf',lines=['Error','no lines passed in']):
and calling it with: <dtml-let link="sping2(fileID=fileId,lines=mylines)">
But, again I seem to get the same (or a similar) error:
===================================================================== Error Type AttributeError
Error Value __getitem__ ... File "C:\PROGRA~1\ZopeSite\Extensions\formatted-strings.py", line 29, in run for line in lines: AttributeError: __getitem__
"lines" is not a list at this place (more generally, it is not a sequence). I do not know why. I would use a debugger (e.g. WingIDE) to understand precisely what happens. Dieter
participants (2)
-
Ashley Lloyd -
Dieter Maurer