[Zope-CMF] Point of publication
Tue, 23 Apr 2002 13:02:49 -0400
It appears that DCWorkflow calls "doActionFor" which in turn calls
"_changeStateOf" (both in DCWorkflow.py). The interesting thing is that the
code for _changeStateOf catches the ObjectMoved exception but doesn't pass
the return value along to doActionFor. In other words, I think my return
value is getting completely lost. Could this be a bug?
I am using Zope 2.5.0 with CMF 1.2 and DCWorkflow 0.4.2
From: email@example.com [mailto:firstname.lastname@example.org]On Behalf
Of Dieter Maurer
Sent: Monday, April 22, 2002 2:39 PM
To: Kevin Carlson
Subject: RE: [Zope-CMF] Point of publication
Kevin Carlson writes:
> Still getting errors when trying to move objects with a script...
> def moveToRep(stateChange) :
> obj = stateChange.object
> dest = p.A
> n = dest._setObject(obj.getId(), obj)
> raise stateChange.ObjectMoved(n, _redirect(n, "Moved"))
> I am getting the following error:
> Error Type: NameError
> Error Value: global name '_redirect' is not defined
A crystal clear error message:
The "_redirect" above is undefined, because you did not define
it. In my script, it is defined as
from urllib import quote_plus
url= '%s/view' % obj.absolute_url()
if msg: url+= '?FeedbackSuccessMessage=%s' % quote_plus(msg)
It redirects to the "view" of the moved object. Not sure, that you
want this redirect...
There is another small problem in your script:
"_setObject" does not return the object but its id.
Therefore, you need:
This remedies the problem you reported in your second mail.
Zope-CMF maillist - Zope-CMF@zope.org
See http://www.zope.org/Products/PTK/Tracker for bug reports and feature