Commit 9462b2c6 authored by Jean-Paul Smets's avatar Jean-Paul Smets

fixed propertyMap


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2088 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7f7d820f
...@@ -137,7 +137,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0): ...@@ -137,7 +137,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0):
# Because of the order we generate accessors, it is still possible # Because of the order we generate accessors, it is still possible
# to overload data access for some accessors # to overload data access for some accessors
ps_list = tuple(ps_list) + getClassPropertyList(klass) ps_list = tuple(ps_list) + getClassPropertyList(klass)
#LOG('ps_list',0, str(ps_list)) LOG('ps_list',0, str(ps_list))
else: else:
ps_list = getClassPropertyList(klass) ps_list = getClassPropertyList(klass)
for base in ps_list: for base in ps_list:
...@@ -159,7 +159,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0): ...@@ -159,7 +159,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0):
else: else:
prop_holder.security = ClassSecurityInfo() # Is this OK for security XXX ? prop_holder.security = ClassSecurityInfo() # Is this OK for security XXX ?
from Utils import initializeDefaultProperties from Utils import initializeDefaultProperties
#LOG('initializeDefaultProperties: %s' % ptype, 0, str(prop_holder.__dict__)) LOG('initializeDefaultProperties: %s' % ptype, 0, str(prop_holder.__dict__))
initializeDefaultProperties([prop_holder], object=self) initializeDefaultProperties([prop_holder], object=self)
#LOG('initializeDefaultProperties: %s' % ptype, 0, str(prop_holder.__dict__)) #LOG('initializeDefaultProperties: %s' % ptype, 0, str(prop_holder.__dict__))
# We should now make sure workflow methods are defined # We should now make sure workflow methods are defined
...@@ -279,9 +279,11 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -279,9 +279,11 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
""" Method overload - properties are now defined on the ptype """ """ Method overload - properties are now defined on the ptype """
global aq_portal_type global aq_portal_type
ptype = self.portal_type ptype = self.portal_type
self._aq_dynamic(None) # Make sure aq_dynamic has been called once #LOG('_propertyMap',0,ptype)
self._aq_dynamic('id') # Make sure aq_dynamic has been called once
if aq_portal_type.has_key(ptype): if aq_portal_type.has_key(ptype):
return tuple(list(getattr(aq_portal_type[ptype], '_properties', None)) + #LOG('_propertyMap ptype',0,list(getattr(aq_portal_type[ptype], '_properties', ())))
return tuple(list(getattr(aq_portal_type[ptype], '_properties', ())) +
list(getattr(self, '_local_properties', ()))) list(getattr(self, '_local_properties', ())))
return ERP5PropertyManager._propertyMap(self) return ERP5PropertyManager._propertyMap(self)
......
...@@ -108,6 +108,8 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -108,6 +108,8 @@ class FolderMixIn(ExtensionClass.Base):
my_id = 1 my_id = 1
while self.hasContent(str(my_id)): while self.hasContent(str(my_id)):
my_id = my_id + 1 my_id = my_id + 1
#LOG('_setLastId', 0, str(self))
#LOG('_setLastId', 0, str(self.aq_base))
self._setLastId(str(my_id)) # Make sure no reindexing happens self._setLastId(str(my_id)) # Make sure no reindexing happens
else: else:
my_id = self.portal_ids.generateNewId(id_group=id_group,default=default,method=method) my_id = self.portal_ids.generateNewId(id_group=id_group,default=default,method=method)
...@@ -247,7 +249,8 @@ be a problem).""" ...@@ -247,7 +249,8 @@ be a problem)."""
security.declareProtected( Permissions.ModifyPortalContent, '_edit' ) security.declareProtected( Permissions.ModifyPortalContent, '_edit' )
_edit = Base._edit _edit = Base._edit
_setPropValue = Base._setPropValue _setPropValue = Base._setPropValue
_propertyMap = Base._propertyMap # are there any others XXX ?
#security.declareProtected( Permissions.DeletePortalContent, 'manage_delObjects' ) #security.declareProtected( Permissions.DeletePortalContent, 'manage_delObjects' )
#manage_delObjects = CopyContainer.manage_delObjects #manage_delObjects = CopyContainer.manage_delObjects
......
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