Greetings again: I was wondering how you refference a url from a python script either as a redierect or as a way of POSTing data. That is to say in one instance I want the page the user is view to be redierected to some url and in the second instance I just want to POST some data something like url/post_method?TRUE=1. Thanks again -matthew
On Tue, 2003-12-02 at 10:35, Matthew Thorley wrote:
Greetings again:
I was wondering how you refference a url from a python script either as a redierect or as a way of POSTing data. That is to say in one instance I want the page the user is view to be redierected to some url and in the second instance I just want to POST some data something like url/post_method?TRUE=1.
---- if context.REQUEST.URL == whatever: # do stuff else: # do different stuff ---- HTH, Dylan
Matthew Thorley wrote:
I was wondering how you refference a url from a python script either as a redierect or as a way of POSTing data. That is to say in one instance I want the page the user is view to be redierected to some url
Read the Zope online help docs and find the RESPONSE object's methods:: context.request.response.redirect(URL)
and in the second instance I just want to POST some data something like url/post_method?TRUE=1.
If it's a Zope object in the same instance, you can do:: folder.post_method(TRUE=1) where 'folder' is the container of that method. (If the method is in the acquisition path, this is 'context'.) Otherwise, you're need to use the Python urllib[2] in an ExternalMethod. --jcc -- "Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design." (http://www.devx.com/java/editorial/15511)
participants (3)
-
Dylan Reinhardt -
J Cameron Cooper -
Matthew Thorley