Commit 5e17819e authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

Add _delPropValue which can be used to del property value without deleting the proeprty itself

parent 0db17646
...@@ -789,6 +789,13 @@ class Base( CopyContainer, ...@@ -789,6 +789,13 @@ class Base( CopyContainer,
pformat(rev1.__dict__), pformat(rev1.__dict__),
pformat(rev2.__dict__))) pformat(rev2.__dict__)))
def _delPropValue(self, property_name):
if self.hasProperty(property_name):
value = None
if property_name.endswith('_list'):
value = []
self._setPropValue(property_name, value)
def _aq_dynamic(self, id): def _aq_dynamic(self, id):
# ahah! disabled, thanks to portal type classes # ahah! disabled, thanks to portal type classes
return None return None
......
...@@ -627,6 +627,9 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, ...@@ -627,6 +627,9 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn,
Title = Base.Title Title = Base.Title
_setPropValue = Base._setPropValue _setPropValue = Base._setPropValue
_propertyMap = Base._propertyMap # are there any others XXX ? _propertyMap = Base._propertyMap # are there any others XXX ?
# Required while Business Manager installation. Better to rely on properties
# from property sheet than on the attributes
_delPropValue = Base._delPropValue
PUT_factory = None PUT_factory = None
# XXX Prevent inheritance from PortalFolderBase # XXX Prevent inheritance from PortalFolderBase
description = None description = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment