Commit 658e6d07 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added support for Setters

Made sure that only ERP5Type.Document classes and factories are generated by default

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10007 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6c334df1
...@@ -59,7 +59,7 @@ from zLOG import LOG, BLATHER, PROBLEM ...@@ -59,7 +59,7 @@ from zLOG import LOG, BLATHER, PROBLEM
# Global Switches # Global Switches
##################################################### #####################################################
INITIALIZE_PRODUCT_RAD = 1 # If set to 0, product documents are not INITIALIZE_PRODUCT_RAD = 0 # If set to 0, product documents are not
# initialized this will divide by two memory # initialized this will divide by two memory
# usage taken by getters and setters 0 value # usage taken by getters and setters 0 value
# is suggested for new ERP5 projetcs # is suggested for new ERP5 projetcs
...@@ -2537,7 +2537,7 @@ def createValueAccessors(property_holder, id, ...@@ -2537,7 +2537,7 @@ def createValueAccessors(property_holder, id,
setattr(property_holder, accessor_name, accessor.dummy_copy(accessor_name)) setattr(property_holder, accessor_name, accessor.dummy_copy(accessor_name))
setter_name = 'set' + UpperCase(id) + 'Value' setter_name = 'set' + UpperCase(id) + 'Value'
setter = Value.Setter(setter_name, id, reindex=1) setter = Value.ListSetter(setter_name, id, reindex=1)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
setattr(property_holder, setter_name, setter) setattr(property_holder, setter_name, setter)
property_holder.security.declareProtected(write_permission, setter_name) property_holder.security.declareProtected(write_permission, setter_name)
...@@ -2560,7 +2560,7 @@ def createValueAccessors(property_holder, id, ...@@ -2560,7 +2560,7 @@ def createValueAccessors(property_holder, id,
property_holder.security.declareProtected(write_permission, setter_name) property_holder.security.declareProtected(write_permission, setter_name)
setter_name = '_set' + UpperCase(id) + 'Value' setter_name = '_set' + UpperCase(id) + 'Value'
setter = Value.Setter(setter_name, id, reindex=0) setter = Value.ListSetter(setter_name, id, reindex=0)
if not hasattr(property_holder, setter_name): if not hasattr(property_holder, setter_name):
setattr(property_holder, setter_name, setter) setattr(property_holder, setter_name, setter)
property_holder.security.declareProtected(write_permission, setter_name) property_holder.security.declareProtected(write_permission, setter_name)
......
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