[Zope] Workflow question

Dieter Maurer dieter at handshake.de
Mon Aug 22 12:45:57 EDT 2005


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".


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.


>	# 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...

You do use a "PUT" function (!) but you do not define it.
Definitely, this will fail...


-- 
Dieter


More information about the Zope mailing list