[Zope] losing my zen with external methods...

Tony McDonald tony.mcdonald@ncl.ac.uk
Thu, 23 Sep 1999 04:45:08 +0100


Hi all,

I've got an external method called minicascade:

def minicascade(self, tag_id)
....

which works fine, ie it renders HTML, if I do something like
.../minicascade?tag_id=13228
but if I try this within a DTML Method (I get the same error if I use a DTML
Document);

<dtml-var "minicascade(tag_id=13228)">

I get
<!--
 Error type:  TypeError
 Error value: not enough arguments; expected 2, got 0
 -->
...

<!--
Traceback (innermost last):
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py,
line 179, in publish
  File /home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/Zope/__init__.py,
line 201, in zpublisher_exception_hook
    (Object: ElementWithAttributes)
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py,
line 165, in publish
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py,
line 160, in mapply
    (Object: searchForm)
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py,
line 102, in call_object
    (Object: searchForm)
  File /home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py,
line 145, in __call__
    (Object: searchForm)
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Strin
g.py, line 502, in __call__
    (Object: searchForm)
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Util.
py, line 321, in eval
    (Object: minicascade(tag_id=13228))
  File &lt;string&gt;, line 0, in ?
  File
/home/nnle/Zope-2.0.0-solaris-2.6-sparc/lib/python/Products/ExternalMethod/E
xternalMethod.py, line 246, in __call__
    (Object: minicascade)
    (Info: ((), {'tag_id': 13228}, None))
TypeError: (see above)

-->

any ideas? this sort of stuff *always* baffles me with Zope, and I end up
getting things done by trial and error...

Tone
ps amazing what a late night curry does for productivity! (or not!) :)