Its nope with zope , parameter prob remains
Ya u got me this time abzlutli but i'm jus not getting it. looks like there is something else. the define code dint work.i'm still getting the same error. Error Type KeyError Error Value 'districtname' I'm attaching the ZPT doc n the ZSQL method getDistrictUser is given below. argument : distname sql :select distinct(username) from c_userdet c,c_district d where d.district_name=<dtml-sqlvar distname type="string"> and c.district_code=d.district_code order by username Since it giving error for districtname. duz dat mean its not finding it in the pyhton stmt : <div tal:repeat="user python:context.getDistrictUser(distname=request.form['districtname'])"> Hope i'nt getting over u. On Fri, 11 Mar 2005 Hong Yuan wrote :
So you are determining the option value of a 2nd dropdown list from the input of the 1st. Then it is obvious that when the page is frist loaded, the form variable 'districtname' is not set yet, because it is set in the form, right?
When this page is first loaded, you maybe want to provide a default value for 'districtname'. I guess this is what you meant.
In that case, you may want to test the existence of request/form/districtname, and if the variable is not there, use a default value for it. One way to do so is:
<div tal:define="distname request/form/districtname | python:'some value'" tal:repeat="user python:context.getDistrictUser(districtname=distname)"> ...
this way you make sure 'distname' has some meaningful value before it is used as a parameter of the ZSQL method.
prabuddha ray wrote at 2005-3-11 10:17 -0000:
Ya u got me this time abzlutli but i'm jus not getting it. looks like there is something else. the define code dint work.i'm still getting the same error.
Error Type KeyError Error Value 'districtname'
You must learn to look at the traceback! You find it in the ZMI's "Root Folder" --> "error_log". -- Dieter
participants (2)
-
Dieter Maurer -
prabuddha ray