[Zope] How do I get product to return other than ZMI page?

Ausum Studio ausum_studio at hotmail.com
Mon Apr 12 16:27:33 EDT 2004


#Script name: "product_creater", meaning the form itself.

def manage_addAction(self, REQUEST):
    "Add instance to parent ObjectManager"
    context.manage_addProduct['myProduct'].manage_addAction(REQUEST.id)
    objectjustcreated = getattr(context, REQUEST.id)

    #property changes: Use as many sentences as you need
    objectjustcreated.manage_changeProperties(title=REQUEST.title)

    REQUEST.RESPONSE.redirect(context.absolute_url() + '/product_creater')

Note that REQUEST can't be None and that you don't need the 'id' parameter,
as it will arrive with the REQUEST, unless you want your script to function
programatically (no forms involved). In fact, the REQUEST=None thing is
meant to be used for those cases.


Ausum



----- Original Message ----- 
From: "John Schinnerer" <johnschinnerer at yahoo.com>
To: "zope list" <zope at zope.org>
Sent: Sunday, April 11, 2004 12:26 AM
Subject: Re: [Zope] How do I get product to return other than ZMI page?


> Hello,
>
> --- Ausum Studio <ausum_studio at hotmail.com> wrote:
> > Use an External Method. If the problem is that the existing one does
> > have the limitation of always redirecting to other places that you
> would like, then start by recreating a working version of that method
> as a External Method, importing just the modules and stuff that you
> need.
> >
> > Then you just remove the unwanted line(s).
>
> It's my own product, so can't I just change what is being done within
> my product, without having to use an external method?
>
> I need to see an example of how to programmatically add an object to a
> folder and set its properties via a web form instead of the ZMI, and
> return the form again instead of the ZMI, in a product I create myself.
>  Can't find anything in Zope Bible, or online searches so far, that
> shows that.
>
> thanks,
> John S.
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th
> http://taxes.yahoo.com/filing.html
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>



More information about the Zope mailing list