[Zope] Its nope with zope , parameter prob remains
prabuddha ray
buddha_2001 at rediffmail.com
Fri Mar 11 05:17:37 EST 2005
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.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: index_html
Type: application/octet-stream
Size: 3403 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050311/bb451a63/index_html.obj
More information about the Zope
mailing list