[Zope] External Method Problem

Ben Ocean zope@thewebsons.com
Tue, 29 Jan 2002 11:39:06 -0800


Hi JIM PENNY and HARRY WILKINSON and all others;
I tried both of your suggestions, but now I get the below complaint with=20
either *context* or *REQUEST* being the NameError. Perhaps I need to import=
=20
another module?
TIA,
BenO

At 11:51 AM 1/29/02 -0500, you wrote:
>On Tue, Jan 29, 2002 at 07:13:21AM -0800, Ben Ocean wrote:
> > Hi;
> > I have this external method:
> >
> > import string, os
> >
> > user_id, banner_id, page =3D os.environ['QUERY_STRING'].split("&")
> > redirect =3D
> >=20
>=
 "http://www.myaffiliateprogram.com/u/%(user_id)s/t.asp?id=3D%(banner_id)s&p=
=3D%(page)s"=20
>
> > % locals()
> > print "Location: %(redirect)s\n" % locals()
> >
> > but when I try and instantiate it as an external method I get this=
 error:
>
>As I read this, you are asking for the variable QUERY_STRING that comes
>from the shell.  There is none.
>
>I think that you are trying to get the QUERY_STRING that comes from the
>browser.  That would be (I am guessing here (untested))
>REQUEST['QUERY_STRING'], or maybe just QUERY_STRING, if you declared
>it as a parameter and passed it in.
>
>Jim
> >
> > Site Error
> > An error was encountered while publishing this resource.
> > Error Type: KeyError
> > Error Value: QUERY_STRING
> >
> > Troubleshooting Suggestions
> > =B7       This resource may be trying to reference a nonexistent object=
 or
> > variable QUERY_STRING.
> > =B7       The URL may be incorrect.
> > =B7       The parameters passed to this resource may be incorrect.
> > =B7       A resource that this resource relies on may be encountering an
> > error.
> > For more detailed information about the error, please refer to the HTML
> > source for this page.
> > If the error persists please contact the site maintainer. Thank you for
> > your patience.
> >
> > What to do?
> > TIA,
> > BenO
> >
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> > http://lists.zope.org/mailman/listinfo/zope-announce
> > http://lists.zope.org/mailman/listinfo/zope-dev )
> >