Commit bb077547 authored by Jérome Perrin's avatar Jérome Perrin

default defined in property sheets was not handled correctly.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10272 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ab786a9a
...@@ -35,6 +35,8 @@ from zLOG import LOG ...@@ -35,6 +35,8 @@ from zLOG import LOG
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type.PsycoWrapper import psyco from Products.ERP5Type.PsycoWrapper import psyco
_MARKER=[]
# Creation of default constructor # Creation of default constructor
class func_code: pass class func_code: pass
...@@ -119,7 +121,6 @@ class Getter(Method): ...@@ -119,7 +121,6 @@ class Getter(Method):
func_code.co_varnames = ('self',) func_code.co_varnames = ('self',)
func_code.co_argcount = 1 func_code.co_argcount = 1
func_defaults = () func_defaults = ()
_default=None
def __init__(self, id, key, property_type, default=None, storage_id=None): def __init__(self, id, key, property_type, default=None, storage_id=None):
self._id = id self._id = id
...@@ -133,9 +134,11 @@ class Getter(Method): ...@@ -133,9 +134,11 @@ class Getter(Method):
self._storage_id = storage_id self._storage_id = storage_id
self._is_tales_type = (property_type == 'tales') self._is_tales_type = (property_type == 'tales')
def __call__(self, instance, default=_default, object=None, *args, **kw): def __call__(self, instance, default=_MARKER, object=None, *args, **kw):
if default is _MARKER:
default = self._default
# No acquisition on properties # No acquisition on properties
value = getattr(aq_base(instance), self._storage_id, None) value = getattr(aq_base(instance), self._storage_id, None)
if value is not None: if value is not None:
if self._is_tales_type and kw.get('evaluate', 1): if self._is_tales_type and kw.get('evaluate', 1):
if object is not None: if object 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