[Zope] How do I get product to return other than ZMI page? -
works!
John Schinnerer
johnschinnerer at yahoo.com
Tue Apr 13 01:58:13 EDT 2004
Hello,
Thank you!! :-)
This...
> REQUEST.RESPONSE.redirect(context.absolute_url() +
> '/product_creater')
Is the missing link bit of syntax/detail I've needed. It works just
the way I need now. I guess it's the same conceptuall as Bill H.'s
reply (thanks Bill!) but the instance.aq_parent part of that example
didn't work for me and I didn't know why or what to change it to.
Mahalo,
John S
--- Ausum Studio <ausum_studio at hotmail.com> wrote:
> #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
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
More information about the Zope
mailing list