[Zope-dev] More almost __call__ ;-)

Chris Withers chrisw@nipltd.com
Fri, 13 Oct 2000 14:02:55 +0100


Toby Dickenson wrote:
> <http://www.zope.org/Members/htrd/howto/FunctionTemplate>
> 
> you would use....
> 
>     def a_method(self,md):
>         do_stuff_with(md['param1'],md['param2'])
>     a_method = FunctionTemplate(a_method)

Okay, spoke too soon... when I do the above and then call the method
with:

<dtml-var a_method>

I get:

Error type: exceptions.AttributeError
Error value: __len__ 

Traceback (innermost last):
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 187, in
publish
  File E:\Zope\2271B4~1.2\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
    (Object: testdefiner)
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 171, in
publish
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\mapply.py, line 160, in
mapply
    (Object: index_html)
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 112, in
call_object
    (Object: index_html)
  File E:\Zope\2271B4~1.2\lib\python\App\special_dtml.py, line 120, in
__call__
    (Object: index_html)
    (Info: E:\Zope\2.2.2\lib\python\Products\A_product\Form.dtml)
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLLocator.py, line
103, in __call__
    (Object: index_html)
  File E:\Zope\2271B4~1.2\lib\python\DocumentTemplate\DT_String.py, line
528, in __call__
    (Object: index_html)
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 288,
in debug_render_blocks
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 286,
in debug_render_blocks
  File E:\Zope\2271B4~1.2\lib\python\DocumentTemplate\DT_In.py, line
691, in renderwob
    (Object: _.range(1,11))
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 288,
in debug_render_blocks
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 286,
in debug_render_blocks
  File E:\Zope\2271B4~1.2\lib\python\DocumentTemplate\DT_Let.py, line
147, in render
    (Object: row=sequence-item)
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 242,
in debug_render_blocks
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 221,
in debugException
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 239,
in debug_render_blocks
  File E:\Zope\2.2.2\lib\python\Products\A_product\FunctionTemplate.py,
line 38, in __call__
AttributeError: (see above)

What's going on?

cheers,

Chris