[Zope] howto call Py_Method w arguments from DTML-Document
hans
hans@beehive.de
Thu, 18 Oct 2001 17:32:09 +0100
i have a Zope 2.1.6 (py 1.5.2) [yes, it stinks, tell my boss]
this means i have no "bindings" in Zopes Python Method Interface.
i try to call from DTML-Document(s) Python Method(s)
(which call ZSQL-Methods).
Both Python Methods and ZSQL-Methods have Parameters.
Using
<dtml-call "Top_upd(_.None, _, arg_TI=TOP_ID, arg_tls=toplangs,
arg_tns=topnames) ">
gives
Error Type: TypeError
Error Value: keyword parameter redefined
...traceback
...lib/python/Products/PythonMethod/PythonMethod.py, line 168, in
__call__
(Object: Top_upd)
(Info: ((None, <TemplateDict object at 871cfd8>), {'arg_tns':
['DTML', 'DTML'], 'arg_tls': [1, 2], 'arg_TI': '1'}, None))
i dont understand this error message, i changed every formal argument to
avoid name clashes.
i have tried calling also with
- ( this, _, kw-args)
same, but different
traceback...lib/python/Products/PythonMethod/PythonMethod.py, line 168,
in __call__
(Object: Top_upd)
(Info: ((<Python Method object at 8611590>, <TemplateDict object at
8672a98>), {'arg_tns': ['DTML', 'DTML'], 'arg_tls': [1, 2], 'arg_TI':
'1'}, None))
TypeError: (see above)
[aside: why "this" in a DTML-Document leads to <Py Meth Obj> i have no
idea]
- ( kw-args)
The last leads to
Error Type: NameError
Error Value: TOP_ID_NAME_upd # <-- zsql-method
...lib/python/Products/PythonMethod/PythonMethod.py, line 168, in
__call__
(Object: Top_upd)
(Info: ((), {'arg_tns': ['DTML', 'DTML'], 'arg_tls': [1, 2],
'arg_TI': '1'}, None))
File <string>, line 16, in Top_upd
NameError: (see above)
a) Is there a definite how-to/reference for
calls of anything callable from anything able to call
including parameter passing
b) what have i made wrong and how to do it right?