Commit 3a9f8950 authored by Jean-Paul Smets's avatar Jean-Paul Smets

default property set on BaseClass (to None)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2074 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 124d9d6e
......@@ -865,7 +865,6 @@ def createExpressionContext(object):
}
return getEngine().getContext(data)
def setDefaultProperties(klass, object=None):
"""
This methods sets default accessors for this object as well
......@@ -991,14 +990,16 @@ def setDefaultProperties(klass, object=None):
# allows to create the equivalent of NULL values
# - new - XXX
# We remove such properties here
from Base import Base as BaseClass
for prop in converted_prop_list:
if prop['type'] in legalTypes:
#if not hasattr(klass, prop['id']):
# setattr(klass, prop['id'], None) # This makes sure no acquisition will happen
# but is wrong when we use storage_id .....
storage_id = prop.get('storage_id', prop['id'])
if not hasattr(klass, storage_id):
setattr(klass, storage_id, None) # This breaks things with aq_dynamic XXX
if not hasattr(BaseClass, storage_id):
# setattr(klass, storage_id, None) # This breaks things with aq_dynamic
setattr(BaseClass, storage_id, None) # This blocks acquisition
#else:
#LOG('existing property',0,str(storage_id))
#if prop.get('default') is not 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