Commit 3505f7a8 authored by Yoshinori Okuji's avatar Yoshinori Okuji

None should be treated as not having a property as in other testers.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17269 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 467f5b34
...@@ -45,6 +45,9 @@ class Setter(Method): ...@@ -45,6 +45,9 @@ class Setter(Method):
Sets an attribute value. ATTRIBUTE_PREFIX and storage_id allow Sets an attribute value. ATTRIBUTE_PREFIX and storage_id allow
a simple form of data access parametrisations a simple form of data access parametrisations
""" """
__slots__ = ('_id', '__name__', '_key', '_reindex', '_property_type',
'_cast', '_null', '_storage_id', )
_need__name__=1 _need__name__=1
# Generic Definition of Method Object # Generic Definition of Method Object
...@@ -122,6 +125,9 @@ class Getter(Method): ...@@ -122,6 +125,9 @@ class Getter(Method):
getSomething(self, [default], [name=value, [name=value], ]) getSomething(self, [default], [name=value, [name=value], ])
""" """
__slots__ = ('_id', '__name__', '_key', '_property_type', '_null',
'_default', '_storage_id', '_is_tales_type', )
_need__name__=1 _need__name__=1
# Generic Definition of Method Object # Generic Definition of Method Object
...@@ -168,6 +174,9 @@ class Tester(Method): ...@@ -168,6 +174,9 @@ class Tester(Method):
""" """
Tests if an attribute value exists Tests if an attribute value exists
""" """
__slots__ = ('_id', '__name__', '_key', '_property_type', '_null',
'_storage_id', )
_need__name__=1 _need__name__=1
# Generic Definition of Method Object # Generic Definition of Method Object
...@@ -188,4 +197,4 @@ class Tester(Method): ...@@ -188,4 +197,4 @@ class Tester(Method):
self._storage_id = storage_id self._storage_id = storage_id
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
return aq_base(instance).__dict__.has_key(self._storage_id) # No acquisition on properties return getattr(aq_base(instance), self._storage_id, None) 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