[Zope] How do I get product to return other than ZMI page?
Chris Withers
lists at simplistix.co.uk
Mon Mar 29 10:46:13 EST 2004
John Schinnerer wrote:
> request = container.REQUEST
> RESPONSE = request.RESPONSE
>
> context.manage_addProduct['myProduct'].manage_addAction(request.id,request)
The standard idiot\widiom used when calling this kind of stuff in a script is:
context.manage_addProduct['myProduct'].manage_addAction(request.id)
...the abscence of a REQUEST is generally taken to mean "don't redirect anywhere".
> from the mxm README example, for manage_addAction I am using
>
> def manage_addAction(self, id=None, REQUEST=None)
> "Add instance to parent ObjectManager"
Will this method ever be the target of a form?
> I'm guessing that the manage_addProduct['myProduct'] in the script is
> somehow hijacking the return from manage_addAction and returning the
> ZMI page...??
Nah ,you'll probably find mxmObjectManager.addClass( has the other half of the
standard idiot init:
if REQUEST is not None:
REQUEST.RESPONSE.redirect('somewhere'
...so try not passign the request through...
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope
mailing list