Re: [Zope3-Users] request ?param=val

2006-04-09 Thread Cliff Ford
I set out to help with an answer to your question this morning, and 
found a bug in my own code that has kept me busy all day. Thanks! Just a 
couple of thoughts:


Are you acquiring the request object from self? If you have a class with 
a function that does some processing:


def getId(self):
id = self.request['id']

Make sure you have the request object Ok.

It is not completely clear that you are not just calling one page 
template from another. So a link in page 1:


a href=page2.html?id= title=Page 2Next/a

could be used in page2.html like this:

pRequest ID = span tal:content=request/id | nothing/span/p

Just check that that works.

HTH

Cliff

Pete Taylor wrote:

Hi all,
I must just be overlooking something, but i'm running into a
problem... (could be that it's 4:00a on a saturday morning, and i'm
writing code for work.  that alone might be my problem ;) ).

I have a url like the following:
http://localhost:8080/MyObject/activate.html?id=

the trouble is, I can't seem to figure out how to get the id= bit back
from the request.  i've read the help on BrowserRequest and
HTTPRequest, and I can see that in _environ there should be a
QUERY_STRING associated with the request, if there are positional
arguments.  however, i can't seem to get at them. 
request.getPositionalArguments just returns ().


basically, i've set up a two-phase registration page, where a user can
register, and a link, along with username and password, is mailed to
them.  I'd like for them to just be able to click the link, have it
hit a view that can process that link, and redirect them to the login
page.

the registration and emailing of the link works just fine.  but the
link itself won't process.  i have activate.html set up as a page
name for a form i built in formlib...  activate is actually the method
i want to call, but even trying the url with activate?id= doesn't
do anything.

i'm at a loss for what to do next.  where should i look to figure this
out?  and does formlib even support this kind of thing, or should i be
using something else?

thanks!
Pete

--
All guilt is relative, loyalty counts, and never let your conscience
be your guide.
  - Lucas Buck, American Gothic
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] request ?param=val

2006-04-08 Thread Bernd Dorn




On 08.04.2006, at 10:26, Pete Taylor wrote:


Hi all,
I must just be overlooking something, but i'm running into a
problem... (could be that it's 4:00a on a saturday morning, and i'm
writing code for work.  that alone might be my problem ;) ).

I have a url like the following:
http://localhost:8080/MyObject/activate.html?id=


v  = request.get('id')




the trouble is, I can't seem to figure out how to get the id= bit back
from the request.  i've read the help on BrowserRequest and
HTTPRequest, and I can see that in _environ there should be a
QUERY_STRING associated with the request, if there are positional
arguments.  however, i can't seem to get at them.
request.getPositionalArguments just returns ().

basically, i've set up a two-phase registration page, where a user can
register, and a link, along with username and password, is mailed to
them.  I'd like for them to just be able to click the link, have it
hit a view that can process that link, and redirect them to the login
page.

the registration and emailing of the link works just fine.  but the
link itself won't process.  i have activate.html set up as a page
name for a form i built in formlib...  activate is actually the method
i want to call, but even trying the url with activate?id= doesn't
do anything.

i'm at a loss for what to do next.  where should i look to figure this
out?  and does formlib even support this kind of thing, or should i be
using something else?

thanks!
Pete

--
All guilt is relative, loyalty counts, and never let your conscience
be your guide.
  - Lucas Buck, American Gothic
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] request ?param=val

2006-04-08 Thread Pete Taylor
that's what i thought too, and what i've tried.  i even tried it from
the interactive shell...

request = TestRequest(/index.html?id=)
request.get('id')

but nothing comes back.  same when i try to get it back in my form class.

hmm...

On 4/8/06, Bernd Dorn [EMAIL PROTECTED] wrote:



 On 08.04.2006, at 10:26, Pete Taylor wrote:

  Hi all,
  I must just be overlooking something, but i'm running into a
  problem... (could be that it's 4:00a on a saturday morning, and i'm
  writing code for work.  that alone might be my problem ;) ).
 
  I have a url like the following:
  http://localhost:8080/MyObject/activate.html?id=

 v  = request.get('id')


 
  the trouble is, I can't seem to figure out how to get the id= bit back
  from the request.  i've read the help on BrowserRequest and
  HTTPRequest, and I can see that in _environ there should be a
  QUERY_STRING associated with the request, if there are positional
  arguments.  however, i can't seem to get at them.
  request.getPositionalArguments just returns ().
 
  basically, i've set up a two-phase registration page, where a user can
  register, and a link, along with username and password, is mailed to
  them.  I'd like for them to just be able to click the link, have it
  hit a view that can process that link, and redirect them to the login
  page.
 
  the registration and emailing of the link works just fine.  but the
  link itself won't process.  i have activate.html set up as a page
  name for a form i built in formlib...  activate is actually the method
  i want to call, but even trying the url with activate?id= doesn't
  do anything.
 
  i'm at a loss for what to do next.  where should i look to figure this
  out?  and does formlib even support this kind of thing, or should i be
  using something else?
 
  thanks!
  Pete
 
  --
  All guilt is relative, loyalty counts, and never let your conscience
  be your guide.
- Lucas Buck, American Gothic
  ___
  Zope3-users mailing list
  Zope3-users@zope.org
  http://mail.zope.org/mailman/listinfo/zope3-users




--
All guilt is relative, loyalty counts, and never let your conscience
be your guide.
  - Lucas Buck, American Gothic
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users