From: dieter <di...@ha...> - 2014-08-22 06:25:06
|
David Siedband <tec...@oc...> writes: > ... > So, I created a script which looks like this: > > = = = = = = = = = > from Products.CMFCore.utils import getToolByName > > plone_utils = getToolByName(context, 'plone_utils') > r = context.REQUEST > > obj = context.aq_explicit > > if obj.hasProperty('layout'): > obj.manage_delProperty('layout') > plone_utils.addPortalMessage(_(u'The layout property has been deleted.'), 'info') > else: > plone_utils.addPortalMessage(_(u'This object has no layout property.'), 'info') > > return r.RESPONSE.redirect(obj.absolute_url()) > = = = = = = = = = > > When I run the script I get the following error about "AttributeError: manage_delProperty" > > Traceback (innermost last): > Module ZPublisher.Publish, line 138, in publish > Module ZPublisher.mapply, line 77, in mapply > Module ZPublisher.Publish, line 48, in call_object > Module Shared.DC.Scripts.Bindings, line 322, in __call__ > Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec > Module Products.PythonScripts.PythonScript, line 344, in _exec > Module script, line 10, in resetLayout > - <PythonScript at /portal/resetLayout used for /portal/data/regional-geo-data/invertebrates> > - Line 10 > AttributeError: manage_delProperty "OFS.PropertyManager.PropertyManager" has the method "manage_delProperties" (but no "manage_delProperty"). |