Simpler way to change ZCataloged ZClass property?
To change a property of a ZClass, where the ZClass instance must be located using ZCatalog, I'm using this Python Script: for i in context.Catalog_Org(userid=666): rid=i.data_record_id_ obj=context.Catalog_Org.getobject(rid) obj.propertysheets.data.manage_changeProperties(userid="777") It works well. But is this the "right" way? It feels rather convoluted to me... I'd like to know if the above can be done in fewer lines, or in a less computationally expensive way. -- Milos Prudek
Milos Prudek <milos.prudek@tiscali.cz> wrote:
for i in context.Catalog_Org(userid=666): rid=i.data_record_id_ obj=context.Catalog_Org.getobject(rid) obj.propertysheets.data.manage_changeProperties(userid="777")
for brain in context.Catalog_Org(userid=666): obj = brain.getObject() obj.propertysheets.data.manage_changeProperties(userid="777")
It works well. But is this the "right" way? It feels rather convoluted to me...
ZClasses are convoluted anyway... Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 10 http://nuxeo.com mailto:fg@nuxeo.com
participants (2)
-
Florent Guillaume -
Milos Prudek