From bb0775470982bc97b9e5db522651c421f7f69cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Sat, 23 Sep 2006 12:06:09 +0000 Subject: [PATCH] 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 --- product/ERP5Type/Accessor/Base.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/product/ERP5Type/Accessor/Base.py b/product/ERP5Type/Accessor/Base.py index 48ca78f74c..bc38c28ca6 100644 --- a/product/ERP5Type/Accessor/Base.py +++ b/product/ERP5Type/Accessor/Base.py @@ -35,6 +35,8 @@ from zLOG import LOG from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.PsycoWrapper import psyco +_MARKER=[] + # Creation of default constructor class func_code: pass @@ -119,7 +121,6 @@ class Getter(Method): func_code.co_varnames = ('self',) func_code.co_argcount = 1 func_defaults = () - _default=None def __init__(self, id, key, property_type, default=None, storage_id=None): self._id = id @@ -133,9 +134,11 @@ class Getter(Method): self._storage_id = storage_id 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 - value = getattr(aq_base(instance), self._storage_id, None) + value = getattr(aq_base(instance), self._storage_id, None) if value is not None: if self._is_tales_type and kw.get('evaluate', 1): if object is not None: -- 2.30.9