Re: [Zope] a redirect of an url in Python

2000-09-01 Thread Bill Welch

Both this one line python method:

raise 'Redirect', 'http://www.zope.org'

and this DTML method


http://www.zope.org


work.

P. S. the double quotes around Redirect in the DTML method are
significant. With single quotes, it shows up as an error named Redirect

Bill.

On Fri, 1 Sep 2000, Kapil Thangavelu wrote:

> in python you have to raise a redirect, search the lists for exact
> syntax 
> something along the lines of
> 
>   raise Redirect "url"


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] a redirect of an url in Python

2000-09-01 Thread Kapil Thangavelu

[EMAIL PROTECTED] wrote:
> 
>Part 1.1Type: Plain Text (text/plain)



in python you have to raise a redirect, search the lists for exact
syntax 
something along the lines of

raise Redirect "url"


Kapil

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] a redirect of an url in Python

2000-09-01 Thread Chris Withers

[EMAIL PROTECTED] wrote:
> 
> I want to redirect my current url to another in Python. I've tried
> return REQUEST.get('url'), but It only writes the url on the screen.

Firstup, posting HTML mail to the list doesn't help anyone ;-)

That said, It sounds like what you want to do is end your python method
with:

return REQUEST.RESPONSE.redirect(REQUEST['url'])

HTH,

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] Réf. : Re: [Zope] a redirect of an url in Python: [Zope] a redirect of an url in Python

2000-09-01 Thread dsergent



Thks for your answer, but it's not the good solution :










Error Type: KeyError
Error Value: redirect


Troubleshooting Suggestions

This resource may be trying to reference a nonexistent object or variable redirect. 
The URL may be incorrect. 
The parameters passed to this resource may be incorrect. 
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. 


Traceback (innermost last):
  File C:\Program Files\ZopeServer\lib\python\ZPublisher\Publish.py, line 222, in publish_module
  File C:\Program Files\ZopeServer\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\Program Files\ZopeServer\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook
    (Object: Traversable)
  File C:\Program Files\ZopeServer\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\Program Files\ZopeServer\lib\python\ZPublisher\mapply.py, line 160, in mapply
    (Object: manage_defined_roles)
  File C:\Program Files\ZopeServer\lib\python\ZPublisher\Publish.py, line 112, in call_object
    (Object: manage_defined_roles)
  File C:\Program Files\ZopeServer\lib\python\AccessControl\Role.py, line 478, in manage_defined_roles
    (Object: Traversable)
  File C:\Program Files\ZopeServer\lib\python\AccessControl\Role.py, line 500, in _addRole
    (Object: Traversable)
  File C:\Program Files\ZopeServer\lib\python\ZPublisher\HTTPRequest.py, line 810, in __getitem__
KeyError: (see above)





try to use REQUEST.redirect(url)


- Original Message - 
From:  [EMAIL PROTECTED] 
To: [EMAIL PROTECTED] 
Sent: Friday, September 01, 2000 1:42  AM
Subject: [Zope] a redirect of an url in  Python


I want to redirect my current  url to another in Python. I've tried return REQUEST.get('url'), but It only  writes the url on the screen. 

Can  anyone help me ? 

thks a  lot 
David Sergent 
A french zoppeur :o)



[Zope] a redirect of an url in Python

2000-09-01 Thread dsergent



I want to redirect my current url to another in Python. I've tried return REQUEST.get('url'), but It only writes the url on the screen.

Can anyone help me ?

thks a lot
David Sergent
A french zoppeur :o)