[Zope] Help with python

Chetan Kumar chetan@cdac.ernet.in
Fri, 09 Aug 2002 22:38:26 +0530


Hi all
Continuing my personal sage of woes with zpt+sql+python here
are some details. Following is the error message as I click on the
submit button (defined in "index_html" which invokes "pyinsert"
which in turn user the ZSQL method "insert").
It says "Missing Input". What is it that I am missing ?
TIA
Chetan


-------------Error Message from Zope------------
Traceback (innermost last):
File /home1/sepg/Site/lib/python/ZPublisher/Publish.py, line 150, in 
publish_module
File /home1/sepg/Site/lib/python/Products/Localizer/__init__.py, line 
65, in new_publish
File /home1/sepg/Site/lib/python/ZPublisher/Publish.py, line 114, in publish
File /home1/sepg/Site/lib/python/Zope/__init__.py, line 159, in 
zpublisher_exception_hook
(Object: Test)
File /home1/sepg/Site/lib/python/ZPublisher/Publish.py, line 98, in publish
File /home1/sepg/Site/lib/python/ZPublisher/mapply.py, line 88, in mapply
(Object: pyinsert)
File /home1/sepg/Site/lib/python/ZPublisher/Publish.py, line 39, in 
call_object
(Object: pyinsert)
File /home1/sepg/Site/lib/python/Shared/DC/Scripts/Bindings.py, line 
252, in __call__
(Object: pyinsert)
File /home1/sepg/Site/lib/python/Shared/DC/Scripts/Bindings.py, line 
283, in _bindAndExec
(Object: pyinsert)
File /home1/sepg/Site/lib/python/Products/PythonScripts/PythonScript.py, 
line 291, in _exec
(Object: pyinsert)
(Info: ({'script': <PythonScript instance at 91265d0>, 'context': 
<Folder instance at 8f8a6f0>, 'container': <Folder instance at 8f8a6f0>, 
'traverse_subpath': []}, (), {}, None))
File Script (Python), line 7, in pyinsert
File /home1/sepg/Site/lib/python/Shared/DC/ZRDB/DA.py, line 414, in __call__
(Object: insert)
File /home1/sepg/Site/lib/python/DocumentTemplate/DT_String.py, line 
473, in __call__
(Object: <string>)
File /home1/sepg/Site/lib/python/Shared/DC/ZRDB/sqlvar.py, line 99, in 
render
(Object: EmpID)
Missing Input: (see above)
------------------------------------------------------------------------------------



-------------index_html------------
<form action="pyinsert">
<input type="text" name="EmpID"><br>
<input type="text" name="FirstName"><br>
<input type="text" name="MidName"><br>
<input type="text" name="LastName"><br>
<input type="text" name="GroupName"><br>
<input type="hidden" name="page" value="/">
<input type="submit">
</form>
--------------------------------------

------------pyinsert----------------
request = container.REQUEST
RESPONSE = request.RESPONSE
sql=container.insert
sql(EmpID="EmpID",FirstName="FirstName", MidName="MidName", 
LastName="LastName",GroupName="GroupName")
RESPONSE.redirect(page)
--------------------------------------

-----------insert---------------------
insert into ActChart.EmpData
(EmpID, FirstName, MidName, LastName, GroupName)
values(
<dtml-sqlvar EmpID type=int>,
<dtml-sqlvar FirstName type=string>,
<dtml-sqlvar MidName type=string> ,
<dtml-sqlvar LastName type=string>,
<dtml-sqlvar GroupName type=string>
)
----------------------------------------

Regards,
Chetan