Search:
 

Change the right properties

Submitted by: peterbe
Last Edited: 2001-07-13

Category: ZClasses

Average rating is: 0.0 out of 5 (0 ratings)

Description:
This recipe is just a little reminder for you ZClass product developer.
When you change the properties of a ZClass instance you can't just do it like you can with a Python product.

All ZClass instances' properties are stored in Common Instance Propertysheet.

Only the Title and Id can be change like you change it of a Python Product.


Source (Text):
# 1) Programmatically change properties of Python Product instance

py_prod_instance.manage_changeProperties({'title':'New Title','url':'www.peterbe.com'})



# 2) Programmatically change properties of ZClass Product instance

zclass_instance.manage_changeProperties({'title':'New Title'})
#but!
zclass_instance.propertysheets.whateveryounamedit.manage_changeProperties({'title':'Again New Title','url':'www.peterbe.com'})

Explanation:
manage_changeProperties() doesn't complain if you send it unrecognized properties. That had me; so now I'm warning you lot.

Comments:

No Comments