Hi, I search a function that return the review_state of an object in Zope. A function like : object.get('review_state') row[0] = object.getId() title = object.Title() row[1] = title row[2] = object.getPhysicalPath() #row[3] = object.get('review_state') Thanks Julian
Hi, In the case of a document proxy managed by CPSWorkflow, I use this: review_state = proxy.getContentInfo()['review_state'] Is this your case? If this is not the right way to do it in my context, I'd of course appreciate your comments :) Hope it helps, Jonathan -----Message d'origine----- De : zope-bounces@zope.org [mailto:zope-bounces@zope.org] De la part de julian Envoyé : vendredi 1 juin 2007 10:10 À : zope@zope.org Objet : [Zope] review_state Hi, I search a function that return the review_state of an object in Zope. A function like : object.get('review_state') row[0] = object.getId() title = object.Title() row[1] = title row[2] = object.getPhysicalPath() #row[3] = object.get('review_state') Thanks Julian _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
Winterflood, Jonathan a écrit :
Hi, In the case of a document proxy managed by CPSWorkflow, I use this:
review_state = proxy.getContentInfo()['review_state']
Is this your case? If this is not the right way to do it in my context, I'd of course appreciate your comments :)
Hope it helps, Jonathan
Thanks for your help :) I have fund a good method :p --------------------------------------------------- from Products.CMFCore.utils import getToolByName from Products.CMFCore.permissions import ManagePortal query = {'portal_type' : 'Document', } for prestataire in self.portal_catalog.searchResults(query): presta_obj = prestataire.getObject() wflow = getToolByName(presta_obj, "portal_workflow", None) if wflow is not None: review_state = wflow.getInfoFor(presta_obj, "review_state") ----------------------------------------------------- So review_state = published or visible... My problem is resolve :) Julian
julian, on 2007-06-01:
from Products.CMFCore.utils import getToolByName from Products.CMFCore.permissions import ManagePortal
query = {'portal_type' : 'Document', }
for prestataire in self.portal_catalog.searchResults(query): presta_obj = prestataire.getObject() wflow = getToolByName(presta_obj, "portal_workflow", None) if wflow is not None: review_state = wflow.getInfoFor(presta_obj, "review_state") -----------------------------------------------------
So review_state = published or visible...
My problem is resolve :)
Great! Some notes that may still help: - I would expect review_state to be in the catalog as well, so instead of using getObject first you could do: review_state = prestataire.review_state - Should you then also want the title or name of the state: review_state_title = wflow.getTitleForStateOnType( review_state, 'Document') -- Maurits van Rees | http://maurits.vanrees.org/ [NL] Work | http://zestsoftware.nl/ "Do not worry about your difficulties in computers, I can assure you mine are still greater."
participants (3)
-
julian -
Maurits van Rees -
Winterflood, Jonathan