Re: Removing "layout" property ? AttributeError: manage_delProperty

dieter <[email protected]>
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <[email protected]>
David Siedband <[email protected]> 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").


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.