diff --git a/product/ERP5Type/Accessor/Acquired.py b/product/ERP5Type/Accessor/Acquired.py index a15c1c29d34f38adaafeda40abde8ff06af39547..1f402b80fed906d36744e16da89a4ae5984e32cb 100755 --- a/product/ERP5Type/Accessor/Acquired.py +++ b/product/ERP5Type/Accessor/Acquired.py @@ -27,6 +27,7 @@ ############################################################################## from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method +from Products.ERP5Type.PsycoWrapper import psyco class DefaultGetter(Method): """ @@ -98,6 +99,8 @@ class DefaultGetter(Method): is_tales_type=is_tales_type ) + psyco.bind(__call__) + Getter = DefaultGetter class ListGetter(Method): @@ -170,4 +173,6 @@ class ListGetter(Method): is_tales_type=is_tales_type ) + psyco.bind(__call__) + SetGetter = ListGetter # ERROR diff --git a/product/ERP5Type/Accessor/AcquiredProperty.py b/product/ERP5Type/Accessor/AcquiredProperty.py index 6358ea61a4c44134e6c157a415438e2dfd5faa47..190692fc7b5b759995c62a0d1a17d156e1cfb1ca 100755 --- a/product/ERP5Type/Accessor/AcquiredProperty.py +++ b/product/ERP5Type/Accessor/AcquiredProperty.py @@ -27,6 +27,7 @@ ############################################################################## from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method +from Products.ERP5Type.PsycoWrapper import psyco class Getter(Method): """ @@ -96,6 +97,8 @@ class Getter(Method): else: return default + psyco.bind(__call__) + class Setter(Method): """ Gets the default reference of a relation diff --git a/product/ERP5Type/Accessor/Base.py b/product/ERP5Type/Accessor/Base.py index 95c8c2d66003a9ca8484869ed560f8f2b2037b18..e3444364ed53377117df98abb35ab53c7fe070be 100755 --- a/product/ERP5Type/Accessor/Base.py +++ b/product/ERP5Type/Accessor/Base.py @@ -33,6 +33,7 @@ from Acquisition import aq_base from zLOG import LOG from Products.ERP5Type.Cache import CachingMethod +from Products.ERP5Type.PsycoWrapper import psyco # Creation of default constructor class func_code: pass @@ -140,6 +141,8 @@ class Getter(Method): return value return default + psyco.bind(__call__) + class Tester(Method): """ Tests if an attribute value exists diff --git a/product/ERP5Type/Accessor/Category.py b/product/ERP5Type/Accessor/Category.py index 003126b65258492adf82396d86f4f2deb4f25c6c..b77817fb131929cefd45d049576921ea86292141 100755 --- a/product/ERP5Type/Accessor/Category.py +++ b/product/ERP5Type/Accessor/Category.py @@ -28,6 +28,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method from zLOG import LOG +from Products.ERP5Type.PsycoWrapper import psyco class Setter(Method): """ @@ -143,6 +144,7 @@ class DefaultGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',()), base=0) + psyco.bind(__call__) class ListGetter(Method): """ @@ -164,6 +166,7 @@ class ListGetter(Method): def __call__(self, instance, *args, **kw): return instance._getAcquiredCategoryMembershipList(self._key, base=0, **kw) + psyco.bind(__call__) SetGetter = ListGetter # XXX ERROR @@ -190,5 +193,7 @@ class ItemListGetter(Method): def __call__(self, instance, *args, **kw): return instance._getAcquiredCategoryMembershipItemList(self._key, base=0, **kw) + psyco.bind(__call__) + # And Tester ??? diff --git a/product/ERP5Type/Accessor/Content.py b/product/ERP5Type/Accessor/Content.py index 1f26f09afbbddff021f175098db998ad235e64e7..2b99e6cc7bcbad501f057ab2f7bb64da55fa9493 100755 --- a/product/ERP5Type/Accessor/Content.py +++ b/product/ERP5Type/Accessor/Content.py @@ -28,6 +28,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method import Base +from Products.ERP5Type.PsycoWrapper import psyco Setter = Base.Setter DefaultSetter = Base.Setter @@ -84,6 +85,8 @@ class ValueGetter(Method): return o return default_result + psyco.bind(__call__) + class ValueListGetter(Method): """ Gets an attribute value. A default value can be @@ -114,8 +117,9 @@ class ValueListGetter(Method): def __call__(self, instance, *args, **kw): # We return the list of matching objects - return map(lambda o:o.getObject(), - self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id_list})) + return [o.getObject() for x in self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id_list})] + + psyco.bind(__call__) DefaultValueGetter = ValueGetter @@ -163,6 +167,8 @@ class Getter(Method): #return o return default_result + psyco.bind(__call__) + class ListGetter(Method): """ Gets an attribute value. A default value can be @@ -192,8 +198,9 @@ class ListGetter(Method): def __call__(self, instance, *args, **kw): # We return the list of matching objects - return map(lambda o:o.relative_url, - self.searchFolder(portal_type = self._portal_type, id = self._storage_id_list)) + return [o.relative_url for o in self.searchFolder(portal_type = self._portal_type, id = self._storage_id_list)] + + psyco.bind(__call__) DefaultGetter = Getter diff --git a/product/ERP5Type/Accessor/ContentProperty.py b/product/ERP5Type/Accessor/ContentProperty.py index 1722ae211725c83bd0d4bd05a2f45fef509dde08..c80082eb40ac61030e4f7e737c66c452d2731494 100755 --- a/product/ERP5Type/Accessor/ContentProperty.py +++ b/product/ERP5Type/Accessor/ContentProperty.py @@ -28,6 +28,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method import Base +from Products.ERP5Type.PsycoWrapper import psyco Setter = Base.Setter DefaultSetter = Base.Setter @@ -85,6 +86,8 @@ class ValueGetter(Method): return o return default_result + psyco.bind(__call__) + class ValueListGetter(Method): """ Gets an attribute value. A default value can be @@ -116,8 +119,9 @@ class ValueListGetter(Method): def __call__(self, instance, *args, **kw): # We return the list of matching objects - return map(lambda o:o.getObject(), - self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id_list})) + return [o.getObject() for o in self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id_list})] + + psyco.bind(__call__) DefaultValueGetter = ValueGetter @@ -166,6 +170,8 @@ class Getter(Method): return o.getProperty(self._acquired_property, default) return default + psyco.bind(__call__) + class Setter(Method): """ Gets an attribute value. A default value can be @@ -248,8 +254,9 @@ class ListGetter(Method): def __call__(self, instance, *args, **kw): # We return the list of matching objects - return map(lambda o:o.relative_url, - self.searchFolder(portal_type = self._portal_type, id = self._storage_id_list)) + return [o.relative_url for o in self.searchFolder(portal_type = self._portal_type, id = self._storage_id_list)] + + psyco.bind(__call__) DefaultGetter = Getter diff --git a/product/ERP5Type/Accessor/List.py b/product/ERP5Type/Accessor/List.py index 26c4362153b3814d8df93278641e27a6d0584e60..fd39c63fc3712302f9035b7d42eb2b1b19113b1f 100755 --- a/product/ERP5Type/Accessor/List.py +++ b/product/ERP5Type/Accessor/List.py @@ -33,6 +33,7 @@ import Base from Products.CMFCore.Expression import Expression from Products.ERP5Type.Utils import createExpressionContext from Products.ERP5Type.Cache import CachingMethod +from Products.ERP5Type.PsycoWrapper import psyco from zLOG import LOG @@ -253,6 +254,8 @@ class DefaultGetter(Method): return list_value[0] return default + psyco.bind(__call__) + Getter = DefaultGetter class ListGetter(Method): @@ -297,6 +300,8 @@ class ListGetter(Method): return list(list_value) return default + psyco.bind(__call__) + SetGetter = ListGetter Tester = Base.Tester diff --git a/product/ERP5Type/Accessor/Object.py b/product/ERP5Type/Accessor/Object.py index 025a50d02fc8aad1d62b475af18949417bff96a5..c46f4eef2b3c7933509bab1325207d7a37f5a46a 100755 --- a/product/ERP5Type/Accessor/Object.py +++ b/product/ERP5Type/Accessor/Object.py @@ -28,6 +28,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method import Base +from Products.ERP5Type.PsycoWrapper import psyco Setter = Base.Setter DefaultSetter = Base.Setter @@ -76,6 +77,8 @@ class ValueGetter(Method): return o return default_result + psyco.bind(__call__) + class ValueListGetter(Method): """ Gets an attribute value. A default value can be @@ -105,8 +108,9 @@ class ValueListGetter(Method): def __call__(self, instance, *args, **kw): # We return the list of matching objects - return map(lambda o:o.getObject(), - self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id_list})) + return [o.getObject() for o in self.contentValues({'portal_type': self._portal_type, 'id': self._storage_id_list})] + + psyco.bind(__call__) DefaultValueGetter = ValueGetter @@ -150,6 +154,8 @@ class Getter(Method): return o.getRelativeUrl() return default_result + psyco.bind(__call__) + class ListGetter(Method): """ Gets an attribute value. A default value can be @@ -179,8 +185,9 @@ class ListGetter(Method): def __call__(self, instance, *args, **kw): # We return the list of matching objects - return map(lambda o:o.relative_url, - self.searchFolder(portal_type = self._portal_type, id = self._storage_id_list)) + return [o.relative_url for o in self.searchFolder(portal_type = self._portal_type, id = self._storage_id_list)] + + psyco.bind(__call__) DefaultGetter = Getter diff --git a/product/ERP5Type/Accessor/Related.py b/product/ERP5Type/Accessor/Related.py index 4dadf3567a8a218d76f12643ed6642b47b7501ad..bb3ec6c06ed7cbfa5ce38d09b1fc1ef7588d46e8 100755 --- a/product/ERP5Type/Accessor/Related.py +++ b/product/ERP5Type/Accessor/Related.py @@ -27,6 +27,7 @@ ############################################################################## from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method +from Products.ERP5Type.PsycoWrapper import psyco class DefaultGetter(Method): """ @@ -55,6 +56,8 @@ class DefaultGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + Getter = DefaultGetter class ListGetter(Method): @@ -84,4 +87,6 @@ class ListGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + SetGetter = ListGetter diff --git a/product/ERP5Type/Accessor/RelatedValue.py b/product/ERP5Type/Accessor/RelatedValue.py index b9ab8f5bc0157f70c2c6c95ca61ce58f8b8d3a75..ec194adcb86155e494c9a0ee4eb69eb90c153d90 100755 --- a/product/ERP5Type/Accessor/RelatedValue.py +++ b/product/ERP5Type/Accessor/RelatedValue.py @@ -27,6 +27,7 @@ ############################################################################## from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method +from Products.ERP5Type.PsycoWrapper import psyco class DefaultGetter(Method): """ @@ -55,6 +56,8 @@ class DefaultGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + Getter = DefaultGetter class ListGetter(Method): @@ -84,6 +87,8 @@ class ListGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + SetGetter = ListGetter # Error XXX class DefaultIdGetter(Method): @@ -113,6 +118,8 @@ class DefaultIdGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + IdGetter = DefaultIdGetter class IdListGetter(Method): @@ -142,6 +149,8 @@ class IdListGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + IdSetGetter = IdListGetter # XXX Error class DefaultTitleGetter(Method): @@ -171,6 +180,8 @@ class DefaultTitleGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + TitleGetter = DefaultTitleGetter class TitleListGetter(Method): @@ -200,6 +211,8 @@ class TitleListGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + TitleSetGetter = TitleListGetter # XXX Error class DefaultPropertyGetter(Method): @@ -229,6 +242,8 @@ class DefaultPropertyGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + PropertyGetter = DefaultPropertyGetter class PropertyListGetter(Method): @@ -258,4 +273,6 @@ class PropertyListGetter(Method): filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) + psyco.bind(__call__) + PropertySetGetter = PropertyListGetter # Error XXX diff --git a/product/ERP5Type/Accessor/Value.py b/product/ERP5Type/Accessor/Value.py index bee30945c829bcc1889d3e54e522f71f931d9c8d..3af3d76e24edd3efbe3bb9b92ace58f6b9d9f593 100755 --- a/product/ERP5Type/Accessor/Value.py +++ b/product/ERP5Type/Accessor/Value.py @@ -28,6 +28,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Method from zLOG import LOG +from Products.ERP5Type.PsycoWrapper import psyco class Setter(Method): """ @@ -53,6 +54,8 @@ class Setter(Method): portal_type=kw.get('portal_type',())) if self._reindex: instance.reindexObject() + psyco.bind(__call__) + ListSetter = Setter SetSetter = Setter # Error XXX DefaultSetter = Setter # Error XXX @@ -81,6 +84,8 @@ class DefaultGetter(Method): LOG("ERP5Type Deprecated Getter Id:",0, self._id) return instance._getDefaultAcquiredValue(self._key, **kw) + psyco.bind(__call__) + Getter = DefaultGetter class ListGetter(Method): @@ -106,9 +111,11 @@ class ListGetter(Method): def __call__(self, instance, *args, **kw): if self._warning: LOG("ERP5Type Deprecated Getter Id:",0, self._id) - LOG("__call__:",0, str((args,kw))) + #LOG("__call__:",0, str((args,kw))) return instance._getAcquiredValueList(self._key, **kw) + psyco.bind(__call__) + SetGetter = ListGetter # Error XXX @@ -139,6 +146,8 @@ class DefaultTitleGetter(Method): return None return o.getTitle() + psyco.bind(__call__) + class TitleListGetter(Method): """ Gets a list of reference objects @@ -158,11 +167,13 @@ class TitleListGetter(Method): self._key = key def __call__(self, instance, *args, **kw): - return map(lambda x:x.getTitle(), instance._getAcquiredValueList(self._key, + return [x.getTitle() for x in instance._getAcquiredValueList(self._key, spec=kw.get('spec',()), filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) - ) + ] + + psyco.bind(__call__) TitleSetGetter = TitleListGetter # Error XXX @@ -194,6 +205,8 @@ class DefaultUidGetter(Method): else: return None + psyco.bind(__call__) + UidGetter = DefaultUidGetter class UidListGetter(Method): @@ -215,11 +228,14 @@ class UidListGetter(Method): self._key = key def __call__(self, instance, *args, **kw): - return map(lambda x:x.getUid(), instance._getAcquiredValueList(self._key, + return [x.getUid() for x in instance._getAcquiredValueList(self._key, spec=kw.get('spec',()), filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) - ) + ] + + psyco.bind(__call__) + UidSetGetter = UidListGetter # Error XXX class UidSetter(Method): @@ -275,6 +291,8 @@ class DefaultIdGetter(Method): else: return None + psyco.bind(__call__) + IdGetter = DefaultIdGetter class DefaultTitleOrIdGetter(Method): @@ -302,6 +320,8 @@ class DefaultTitleOrIdGetter(Method): else: return None + psyco.bind(__call__) + TitleOrIdGetter = DefaultTitleOrIdGetter class DefaultLogicalPathGetter(Method): @@ -329,6 +349,8 @@ class DefaultLogicalPathGetter(Method): else: return None + psyco.bind(__call__) + LogicalPathGetter = DefaultLogicalPathGetter class IdListGetter(Method): @@ -350,11 +372,13 @@ class IdListGetter(Method): self._key = key def __call__(self, instance, *args, **kw): - return map(lambda x:x.getId(), instance._getAcquiredValueList(self._key, + return [x.getId() for x in instance._getAcquiredValueList(self._key, spec=kw.get('spec',()), filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) - ) + ] + + psyco.bind(__call__) IdSetGetter = IdListGetter # Error XXX @@ -377,11 +401,11 @@ class LogicalPathListGetter(Method): self._key = key def __call__(self, instance, *args, **kw): - return map(lambda x:x.getLogicalPath(), instance._getAcquiredValueList(self._key, + return [x.getLogicalPath() for x in instance._getAcquiredValueList(self._key, spec=kw.get('spec',()), filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) - ) + ] LogicalPathSetGetter = LogicalPathListGetter # Error XXX @@ -413,6 +437,8 @@ class DefaultPropertyGetter(Method): else: return None + psyco.bind(__call__) + PropertyGetter = DefaultPropertyGetter class PropertyListGetter(Method): @@ -434,9 +460,12 @@ class PropertyListGetter(Method): self._key = key def __call__(self, instance, key, *args, **kw): - return map(lambda x:x.getProperty(key), instance._getAcquiredValueList(self._key, + return [x.getProperty(key) for x in instance._getAcquiredValueList(self._key, spec=kw.get('spec',()), filter=kw.get('filter', None), portal_type=kw.get('portal_type',())) - ) + ] + + psyco.bind(__call__) + PropertySetGetter = PropertyListGetter # Error XXX diff --git a/product/ERP5Type/Accessor/WorkflowState.py b/product/ERP5Type/Accessor/WorkflowState.py index 83440d96f2eafd93511f1dce352311504f0ee5df..cf6c953d457ac0050c0cfbd94fa551efff93a7b1 100755 --- a/product/ERP5Type/Accessor/WorkflowState.py +++ b/product/ERP5Type/Accessor/WorkflowState.py @@ -28,6 +28,7 @@ from Accessor import Accessor as Method from Products.CMFCore.utils import getToolByName +from Products.ERP5Type.PsycoWrapper import psyco # Creation of default constructor class func_code: pass @@ -56,6 +57,8 @@ class Getter(Method): wf = portal_workflow.getWorkflowById(self._key) return wf._getWorkflowStateOf(instance, id_only=1) + psyco.bind(__call__) + class TitleGetter(Method): """ Gets the title of the current state @@ -78,4 +81,6 @@ class TitleGetter(Method): portal_workflow = getToolByName(instance, 'portal_workflow') wf = portal_workflow.getWorkflowById(self._key) return wf._getWorkflowStateOf(instance).title + + psyco.bind(__call__)