[ZPT] Parameter from Python Script to SqlMethod

Damir Bartakovic damir@stud.fbi.fh-darmstadt.de
Fri, 1 Feb 2002 12:55:55 +0100 (CET)


Hi again,

I have this:

for emp in context.PkSelectMethod(personsid):
    pers_forename = emp.pers_forename
    pers_name = emp.pers_name
    print pers_forename, pers_name

return printed

PkSelectMethod is a SqlMethod which requires the parameter
"pk_pers_personsid". When I call this script I get :
"Missing input variable, pk_pers_personsid"
The traceback is attached.

Calling SqlMethods without parameter works fine. So writing
"PkSelectMethod(personsid)" is not the right way of giving prameter to a
script?
No, this time I didn't forget to define the parameter in the sqlMethod :)
The Method works fine. I am calling this from a ZPT but like seems thats
not the problem or?
Where I am wrong this time?


Traceback (innermost last):
  File /usr/local/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line 150,
in publish_module
  File /usr/local/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line 114,
in publish
  File /usr/local/Zope-2.5.0/lib/python/Zope/__init__.py, line 158, in
zpublisher_exception_hook
    (Object: PE_Employees)
  File /usr/local/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line 98, in
publish
  File /usr/local/Zope-2.5.0/lib/python/ZPublisher/mapply.py, line 88, in
mapply
    (Object: test)
  File /usr/local/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line 39, in
call_object
    (Object: test)
  File /usr/local/Zope-2.5.0/lib/python/Shared/DC/Scripts/Bindings.py,
line 252, in __call__
    (Object: test)
  File /usr/local/Zope-2.5.0/lib/python/Shared/DC/Scripts/Bindings.py,
line 283, in _bindAndExec
    (Object: test)
  File
/usr/local/Zope-2.5.0/lib/python/Products/PythonScripts/PythonScript.py,
line 291, in _exec
    (Object: test)
    (Info: ({'script': <PythonScript instance at 8d71aa8>,
'context': <TransparentFolder instance at 8fd9a20>, 'container':
<TransparentFolder instance at 8fd9a20>, 'traverse_subpath': []},
(), {}, None))
  File Script (Python), line 1, in test
  File /usr/local/Zope-2.5.0/lib/python/Shared/DC/ZRDB/DA.py, line 414, in
__call__
    (Object: PkSelectMethod)
  File /usr/local/Zope-2.5.0/lib/python/DocumentTemplate/DT_String.py,
line 473, in __call__
    (Object: <string>)
  File /usr/local/Zope-2.5.0/lib/python/Shared/DC/ZRDB/sqlvar.py, line 99,
in render
    (Object: pk_pers_personsid)
Missing Input: (see above)