[ZPT] RE: ZPT digest, Vol 1 #667 - 6 msgs
Mark Fallu
mfallu@optushome.com.au
Sat, 22 Feb 2003 12:50:52 +1000
-----Original Message-----
From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of =
zpt-request@zope.org
Sent: Saturday, 22 February 2003 3:00 AM
To: zpt@zope.org
Subject: ZPT digest, Vol 1 #667 - 6 msgs
Send ZPT mailing list submissions to
zpt@zope.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.zope.org/mailman/listinfo/zpt
or, via email, send a message with subject or body 'help' to
zpt-request@zope.org
You can reach the person managing the list at
zpt-admin@zope.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of ZPT digest..."
Today's Topics:
1. Passing ZSQL Method an argument/variable with ZPT (Daniel Tang)
2. Re: Passing ZSQL Method an argument/variable with ZPT =
(=3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D)
3. Re: Passing ZSQL Method an argument/variable with ZPT (Daniel =
Tang)
4. Re: Passing ZSQL Method an argument/variable with ZPT =
(=3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D)
5. Re: Re: Passing ZSQL Method an argument/variable with ZPT (Daniel =
Tang)
6. Re: Re: Passing ZSQL Method an argument/variable with ZPT =
(=3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D)
--__--__--
Message: 1
Date: Thu, 20 Feb 2003 16:01:32 -0500 (EST)
From: Daniel Tang <dtang@chronicle.com>
Reply-To: daniel.tang@chronicle.com
To: zpt@zope.org
Subject: [ZPT] Passing ZSQL Method an argument/variable with ZPT
Hello,
I am trying to send an argument to an SQL Method in my expression below,
but to no avail. I've tried numerous ways to include the variable which
is passed in by a form. Is there something wrong with this?
Page template:
<select name=3D"result" size=3D"10" tal:define=3D"options =
container/get_id(my_id=3D{request.form['id']})">
<option tal:repeat=3D"option options"
tal:attributes=3D"value option/job_id"
tal:content=3D"option/job_id">job_id</option>
</select>
SQL Method:
Arguments: my_id
SELECT job_id FROM inventory WHERE (my_id =3D <dtml-sqlvar my_id =
type=3D"string">
I get an error on trying to get the results. Any ideas?
TIA,
Daniel
--__--__--
Message: 2
Date: Thu, 20 Feb 2003 22:18:50 +0100
From: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
Reply-To: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
Organization: elvix
To: "Daniel Tang on The ZPT Mailinglist" <dtang@chronicle.com>
Cc: ZPT@zope.org
Subject: Re: [ZPT] Passing ZSQL Method an argument/variable with ZPT
DT> Is there something wrong with this?
yes :)
DT> <select name=3D3D"result" size=3D3D"10" tal:define=3D3D"options =
container/g=3D
et_id(my_id=3D3D{request.form['id']})">
becomes
<select name=3D3D"result" size=3D3D"10" tal:define=3D3D"options =
python:cont=3D
ainer.get_id(my_id=3D3D{request.form['id']})">
.. and i am not sure about using "options" as a variable name.. as it
is already in use..
:)
--
Geir B=3DE6kholt
--__--__--
Message: 3
Date: Thu, 20 Feb 2003 16:38:29 -0500 (EST)
From: Daniel Tang <dtang@chronicle.com>
Reply-To: daniel.tang@chronicle.com
To: "[ISO-8859-15] Geir Bkholt" <geir@elvix.com>, zpt@zope.org
Subject: [ZPT] Re: Passing ZSQL Method an argument/variable with ZPT
Hello,
After using all these below... it seems that the variable being passed =
is
still not going through.
<select name=3D"result" size=3D"10" tal:define=3D"jobclasses
python:here.get_id(my_id=3Drequest.form['id'])">
<select name=3D"result" size=3D"10" tal:define=3D"jobclasses
python:here.get_id(my_id=3D'${request.form.id}')">
<select name=3D"result" size=3D"10" tal:define=3D"jobclasses
container/get_id(my_id=3Dstring('${request/form/id}'))">
<select name=3D"result" size=3D"10" tal:define=3D"jobclasses
python:container.get_id(my_id=3Drequest.form['id'])">
<select name=3D"result" size=3D"10" tal:define=3D"jobclasses
python:container.get_id(my_id=3D{request.form['id']})">
The ZSQL method is: get_id
SELECT job_id FROM inventory WHERE (my_id =3D <dtml-sqlvar my_id
type=3D"string">
Is this because of the variable being a particular typecast, like =
integer
vs. string? (I am using zope 2.5.0 on a red hat linux box).
Thanks,
--Daniel
DT> Is there something wrong with this?
yes :)
DT> <select name=3D"result" size=3D"10" tal:define=3D"options
container/get_id(my_id=3D{request.form['id']})">
becomes
<select name=3D"result" size=3D"10" tal:define=3D"options
python:container.get_id(my_id=3D{request.form['id']})">
.. and i am not sure about using "options" as a variable name.. as it
is already in use..
:)
--
Geir Bkholt
---------- Forwarded message ----------
Date: Thu, 20 Feb 2003 16:01:32 -0500 (EST)
From: Daniel Tang <dtang@chronicle.com>
Reply-To: daniel.tang@chronicle.com
To: zpt@zope.org
Subject: Passing ZSQL Method an argument/variable with ZPT
Hello,
I am trying to send an argument to an SQL Method in my expression below,
but to no avail. I've tried numerous ways to include the variable which
is passed in by a form. Is there something wrong with this?
Page template:
<select name=3D"result" size=3D"10" tal:define=3D"options =
container/get_id(my_id=3D{request.form['id']})">
<option tal:repeat=3D"option options"
tal:attributes=3D"value option/job_id"
tal:content=3D"option/job_id">job_id</option>
</select>
SQL Method:
Arguments: my_id
SELECT job_id FROM inventory WHERE (my_id =3D <dtml-sqlvar my_id =
type=3D"string">
I get an error on trying to get the results. Any ideas?
TIA,
Daniel
--__--__--
Message: 4
Date: Thu, 20 Feb 2003 22:48:12 +0100
From: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
Reply-To: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
Organization: elvix
To: "Daniel Tang on The ZPT Mailinglist" <dtang@chronicle.com>
Cc: ZPT@zope.org
Subject: [ZPT] Re: Passing ZSQL Method an argument/variable with ZPT
DT> Hello,
DT> After using all these below... it seems that the variable being =
passe=3D
d is
DT> still not going through.
DT> <select name=3D3D"result" size=3D3D"10" tal:define=3D3D"jobclasses
DT> python:here.get_id(my_id=3D3Drequest.form['id'])">
DT> The ZSQL method is: get_id
DT> SELECT job_id FROM inventory WHERE (my_id =3D3D <dtml-sqlvar my_id
DT> type=3D3D"string">
Does the ZSQL method have the parameter my_id defined ?
DT> Is this because of the variable being a particular typecast, like =
int=3D
eger
DT> vs. string? (I am using zope 2.5.0 on a red hat linux box).
in your database, "my_id" has to be a string column to match.
Do you get an error message when it fails ?
--
Geir B=3DE6kholt
--__--__--
Message: 5
Date: Thu, 20 Feb 2003 17:56:23 -0500 (EST)
From: Daniel Tang <dtang@chronicle.com>
Reply-To: daniel.tang@chronicle.com
To: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
cc: ZPT@zope.org
Subject: Re: [ZPT] Re: Passing ZSQL Method an argument/variable with ZPT
Hello,
I've gotten it to work after looking at all the variable settings. I =
had
a form parameter keep giving me an error. My fault for not double
checking the symptoms more carefully.
Thanks, and I appreciate the help, the Zope community rocks.
--Daniel
On Thu, 20 Feb 2003, [ISO-8859-15] Geir B=3DE6kholt wrote:
> DT> Hello,
>
> DT> After using all these below... it seems that the variable being =
passe=3D
d is
> DT> still not going through.
>
> DT> <select name=3D3D"result" size=3D3D"10" tal:define=3D3D"jobclasses
> DT> python:here.get_id(my_id=3D3Drequest.form['id'])">
>
> DT> The ZSQL method is: get_id
>
> DT> SELECT job_id FROM inventory WHERE (my_id =3D3D <dtml-sqlvar my_id
> DT> type=3D3D"string">
>
> Does the ZSQL method have the parameter my_id defined ?
>
> DT> Is this because of the variable being a particular typecast, like =
int=3D
eger
> DT> vs. string? (I am using zope 2.5.0 on a red hat linux box).
>
> in your database, "my_id" has to be a string column to match.
>
> Do you get an error message when it fails ?
>
> --
> Geir B=3DE6kholt
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://mail.zope.org/mailman/listinfo/zpt
>
--__--__--
Message: 6
Date: Fri, 21 Feb 2003 11:44:17 +0100
From: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
Reply-To: =3D?ISO-8859-15?B?R2VpciBC5mtob2x0?=3D <geir@elvix.com>
Organization: elvix
To: "Daniel Tang on The ZPT Mailinglist" <dtang@chronicle.com>
Cc: ZPT@zope.org
Subject: Re: [ZPT] Re: Passing ZSQL Method an argument/variable with ZPT
DT> Hello Geir,
DT> I figured it out... I had the form variable misnamed when it was =
givi=3D
ng
DT> the error. Thanks a million though, for helping me. This zope =
thing=3D
of
DT> mine is finally gettin' somewhere! Thanks!
No problem :)
- glad it finally worked out.
--
Geir B=3DE6kholt
--__--__--
_______________________________________________
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt
End of ZPT Digest