[Zope] adding properties trough pythonscript

rv000299 buro-a.it at pi.be
Fri Oct 15 06:24:49 EDT 2004


Hi all,

I have some problems adding properties trough a python script

def publishcontainer(container,path):
  ov=map(lambda x:(x.id,x), container.objectValues())
  ov.sort()
  for (oid,obj) in ov:
    if not (hasattr(obj,"isPortalContent") or obj.isPrincipiaFolderish):
       continue
    id=""
    if hasattr(obj,"isPortalContent"):
       print "ID: ",path+"/"+str(obj.id)
       try:
         context.manage_addProperty('prop', 0, 'boolean')
         print "prop added<br>"
       except:
         print "adding prop to",str(obj.id),"failed<br>"
    if hasattr(obj,"objectValues"):
       print publishcontainer(obj,path+"/"+str(obj.id))
  return printed

The problem is not getting the property added, it does, but editing it
afterwards in the ZMI is impossible. When I hit the Properties tab of the
item, the newly added property is not on the page. However when I call the
prop with a dtml-var it is rendered.

I'm at a loss here. Can someone help me out?

Roel


-----------------------------------------------------
Make cheaper and longer calls thanks to Scarlet Phone 
More info at http://www.scarlet.be/nl/consumer/phone/



More information about the Zope mailing list