[Zope3-Users] Re: interrupt formlib and AddForm

Jürgen Kartnaller juergen at kartnaller.at
Sun Jan 14 02:57:28 EST 2007



Peter Koppatz wrote:
> Hi,
> 
> with formlib I want's to add a new object to a container. This is done 
> with AddForm.
> If an object with the same name already exists  I want to redirect to 
> this  object in the container.
> 
> How is this achieved?
> 
> The last line I found with google but  dosn't work because there is no 
> package with a method getAbsoluteURL.
> 
> def create(self, data):
>         if data['name'] in self.context.__parent__:
>             
> self.request.response.redirect(getAbsoluteURL(self.context.__parent__,self.request))
This will help you:
from zope.traversing.browser.absoluteurl import absoluteURL
> 
> 
> 
> Thanks I advance,
> 
> Peter
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users



More information about the Zope3-users mailing list