[Zope] How can I let ZSQL method know the variable i define.

Paz paz@chello.nl
Sun, 28 Oct 2001 11:35:22 +0100


Hi,

Try sending it throught the REQUEST since that is where you set it. If =
you want it to be temporary, use the <dtml-let =
pageurl=3D"REQUEST['URL0']"> around the in. I personally use a little =
trick to put a character after every operand statement (in, if, else, =
except, etc) so I can see what has passed and what has failed. Nested =
statements can be a bit tricky if you aren=E2=80=99t sure where youre =
at.

Btw, Gadfly is more than capable of meeting your needs with this.=20

<dtml-in "getPageViews(pageurl=3DREQUEST['pageurl'])">

Regards,
Paul Zwarts

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of =
Eiffel
Sent: Sunday, October 28, 2001 4:16 AM
To: Zope-List
Subject: Re: [Zope] How can I let ZSQL method know the variable i =
define.

hi:
    i really crazy about this question, i simplify the question

i rewrite the code and simplify it

<dtml-call "REQUEST.set('pageurl', URL0)">
<dtml-in "test_for_page_count(pageurl=3Dpageurl)">
<dtml-in "getPageViews(pageurl=3Dpageurl)">
<center>
This page has been viewed <b><dtml-var pagecount></b> time.=20
</center>
</dtml-in>
</dtml-in>

it disply nothing, when i hard code pageurl variable and rewrite it like =
this=20

<dtml-call "REQUEST.set('pageurl', URL0)">
<dtml-in "test_for_page_count(pageurl=3D'/')">
<dtml-in "getPageViews(pageurl=3D'/' )">
<center>
This page has been viewed <b><dtml-var pagecount></b> time.=20
</center>
</dtml-in>
</dtml-in> =20

well, this time it works, so it means that=20

<dtml-in "test_for_page_count(pageurl=3Dpageurl)"> could not forward =
parameter to ZSQL method.

even I rewrite code like this,

<dtml-in "test_for_page_count(_.None,_,pageurl=3Dpageurl)">

still does not work.

i was wondering that if zope's builtin database gadfly is fit for this =
small code.

f=E6=AB=80f=E5=BE=AE=E4=BA=8C=E9=A1=B6=E5=84=95=E7=85=B5~=E2=85=B0=E8=86=8A=
?=EE=94=86j=E6=9F=8C=EE=9D=8F=E5=BE=AE=E6=AB=83=E6=9E=88=EF=A3=B5y=EE=95=A0=
=EE=9D=8F=E5=BE=AE=E6=AB=83=E6=9E=88=EF=A3=B5y