[Zope] Problems with External Script
Ben Ocean
zope@thewebsons.com
Wed, 30 Jan 2002 12:01:22 -0800
At 02:21 PM 1/30/02 -0500, you wrote:
>These forms should work, and are all roughly
>equivalent.
>
><dtml-var expr="this().myaffiliateprogram()"> (not tested, but more OO)
Threw error. Something about *this()* not having an object
*myaffiliateprogram()*
><dtml-var "this().myaffiliateprogram()">
Didn't try
><dtml-var expr="myaffiliateprogram(this())"> (known to work)
Used this one. Changed the method to read:
import string
def myaffiliateprogram(REQUEST):
user_id, banner_id, page =
REQUEST['user_id'],REQUEST['banner_id'],REQUEST['page']
redirect =
"http://www.myaffiliateprogram.com/u/%(user_id)s/t.asp?id=%(banner_id)s&p=%(page)s"
% locals()
print "Location: %(redirect)s\n" % locals()
(in other words, took out the references to *self*, as in *self.REQUEST*,
which threw the same error as before). Used this url:
http://www.constructioncalc.com/test?user_id=111&banner_id=222&page=333
got this return:
None
Closer?
TIA,
BenO