[Zope] Workflow question
David Pratt
fairwinds at eastlink.ca
Mon Aug 22 14:12:09 EDT 2005
Hi Dieter.
On Monday, August 22, 2005, at 01:45 PM, Dieter Maurer wrote:
> David Pratt wrote at 2005-8-21 23:43 -0300:
>> ...
>> # Catch put in traversal
>> def __bobo_traverse__(self, REQUEST):
>> method=REQUEST.get('REQUEST_METHOD', 'GET')
>> if method == 'PUT':
>> PUT(REQUEST, RESPONSE)
>
> Usually, "__bobo_traverse__" gets an additional argument.
> I expect that you will get a "TypeError: wrong number of arguments".
>
Ok thanks, I'll look at what else it requires
> After you fixed this, the code might work in your special case --
> but it is not using the correct idiom:
>
> Usually, you want to handle the request method only
> at the end of the traversal and not at each intermediate
> place. For this, you can look at
> "REQUEST['TraversalRequestNameStack']". It contains the
> traversal steps still to be performed.
Thanks. I'll look at this as well.
>
>
>> # Using default put method from NullResource
>> def _default_PUT_factory( self, name, typ, body ):
>> ...
>> def PUT(self, REQUEST, RESPONSE):
>> ...
>
> Why do you override these methods as apparently, you do not use
> them...
I guess my thought it that I want everything to happen normally with
the PUT except no object creation (which seemed to occur where I had
commented it out) of the PUT method. My workflow script and method
from a tool still needs the content type and body for processing so
overriding the original methods seemed a reasonable way to go.
I'm hoping to get something together enough to test today or tomorrow.
Regards
David
More information about the Zope
mailing list