You are here: Home Plone My Python Scripts Set a propertie to an object
Search
Advanced Search…
E-Mail

Webmail: webmail.wyden.com

E-Mail Preferences: postfix.wyden.com/users

E-Mail Administration: postfix.wyden.com

Statistics
Total: 463
Total Pages: 284
Total Folders: 87
Total Files: 18
Total Links: 26
Last modification: 03.02.2012 16:00
 

Set a propertie to an object

by Wyden Silvan last modified 06.11.2009 08:48

 

def setProperty(context, property, value, type='string'):
    if context.hasProperty(property):
        context.manage_changeProperties({property: value})
    else:
        context.manage_addProperty(property, value, type)

setProperty(context, 'myproperty', 'myvalue')

#get the property
myproperty = context.get('myproperty', none)