diff --git a/product/ERP5Form/PreferenceTool.py b/product/ERP5Form/PreferenceTool.py index b3ff4ecdcf632812b84063a55bb5f60afd08f548..d96ab34757b10952fbce664fe57e1bdd10f1203a 100644 --- a/product/ERP5Form/PreferenceTool.py +++ b/product/ERP5Form/PreferenceTool.py @@ -31,7 +31,7 @@ from AccessControl import ClassSecurityInfo from AccessControl.SecurityManagement import getSecurityManager,\ setSecurityManager, newSecurityManager from AccessControl.ZopeGuards import guarded_getattr -from MethodObject import Method +from Products.ERP5Type.Accessor.Base import Getter from Products.ERP5Type.Globals import InitializeClass, DTMLFile from zLOG import LOG, PROBLEM @@ -54,7 +54,7 @@ class Priority: class func_code: pass -class PreferenceMethod(Method): +class PreferenceMethod(Getter): """ A method object that lookup the attribute on preferences. """ # This is required to call the method form the Web __code__ = func_code = func_code() diff --git a/product/ERP5Type/Accessor/Base.py b/product/ERP5Type/Accessor/Base.py index aa2fa56f52ed86818dda39ea18615ab5a85dc761..ccb93ec7af69016d533d66571261ff4fd9cd3e5e 100644 --- a/product/ERP5Type/Accessor/Base.py +++ b/product/ERP5Type/Accessor/Base.py @@ -203,19 +203,10 @@ class Getter(Method): return getattr(roles, '__of__', lambda aq_parent: roles)(self) -class Tester(Method): +class Tester(Getter): """ Tests if an attribute value exists """ - _need__name__=1 - - # Generic Definition of Method Object - # This is required to call the method form the Web - __code__ = func_code = func_code() - __code__.co_varnames = ('self',) - __code__.co_argcount = 1 - __defaults__ = func_defaults = () - def __init__(self, id, key, property_type, storage_id=None): self._id = id self.__name__ = id diff --git a/product/ERP5Type/Accessor/Content.py b/product/ERP5Type/Accessor/Content.py index af0648285eec827d1c96b26784cc30de5befd50d..b4211c1f0bfa2cfb422a1d816993de2a26c6dded 100644 --- a/product/ERP5Type/Accessor/Content.py +++ b/product/ERP5Type/Accessor/Content.py @@ -208,7 +208,7 @@ class ListGetter(Base.Getter): DefaultGetter = Getter -class Tester(Method): +class Tester(Base.Tester): """ Tests if an attribute value exists """ diff --git a/product/ERP5Type/Accessor/ContentProperty.py b/product/ERP5Type/Accessor/ContentProperty.py index 731a7990a706da3ca144cd4903d825fe849cf2f3..d0f2e42d86cab0b24f9e4e17d06532b258b7ab18 100644 --- a/product/ERP5Type/Accessor/ContentProperty.py +++ b/product/ERP5Type/Accessor/ContentProperty.py @@ -267,7 +267,7 @@ class ListGetter(Base.Getter): DefaultGetter = Getter -class Tester(Method): +class Tester(Base.Tester): """ Tests if an attribute value exists """ diff --git a/product/ERP5Type/Accessor/Translation.py b/product/ERP5Type/Accessor/Translation.py index a3445072efd95a39f2076fa5fb2f7158802f1cf2..e303a5ebba43842beeca0e2ad92141a2d810bf20 100644 --- a/product/ERP5Type/Accessor/Translation.py +++ b/product/ERP5Type/Accessor/Translation.py @@ -31,7 +31,7 @@ from zLOG import LOG from Products.ERP5Type.PsycoWrapper import psyco from Acquisition import aq_base -from Products.ERP5Type.Accessor.Base import func_code, ATTRIBUTE_PREFIX, evaluateTales, Getter as BaseGetter, Method +from Products.ERP5Type.Accessor.Base import func_code, ATTRIBUTE_PREFIX, evaluateTales, Getter as BaseGetter, Setter as BaseSetter, Tester as BaseTester from Products.ERP5Type.Accessor import Accessor, AcquiredProperty from Products.ERP5Type.Accessor.TypeDefinition import type_definition from Products.ERP5Type.Utils import unicode2str @@ -218,7 +218,7 @@ class AcquiredPropertyGetter(AcquiredProperty.Getter): else: return default -class TranslatedPropertyTester(Method): +class TranslatedPropertyTester(BaseTester): """ Tests if an attribute value exists """