I am trying to return the state of objects using the following code:
workflow = getToolByName(context,'portal_workflow') status = workflow.getInfoFor(obj,'review_state')
When I try to execute the output using:
print "State: %s" % (status)
I get the following error:
Exception type workflow
Exception Exception Meaning No workflow provides the information "$ {name}".
I read a little on the Internet, but nothing gives a definitive answer.
Can anyone help?
EDIT This does not apply to an object that does not have a workflow. The im object trying to get state for uses a user workflow. However, switching this to using the plone workflow still causes the same error.
Fixed Just try the simplest thing:
status = obj.review_state
It works! go figure. Anyway, thanks.
Moderators, you can delete this post if you want.
source share