[Erp5-report] r42398 nicolas.dumazet - /erp5/trunk/products/ERP5Type/dynamic/lazy_class.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jan 18 08:46:20 CET 2011
Author: nicolas.dumazet
Date: Tue Jan 18 08:46:20 2011
New Revision: 42398
URL: http://svn.erp5.org?rev=42398&view=rev
Log:
meta_type of the form 'ERP5 ' + portal_type_name to portal type classes
This allows us to delay even more the point when Zope forcibly unghosts
objects.
Modified:
erp5/trunk/products/ERP5Type/dynamic/lazy_class.py
Modified: erp5/trunk/products/ERP5Type/dynamic/lazy_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/lazy_class.py?rev=42398&r1=42397&r2=42398&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/lazy_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/lazy_class.py [utf8] Tue Jan 18 08:46:20 2011
@@ -50,6 +50,8 @@ class GhostBaseMetaClass(ExtensionClass)
Because __bases__ is changed, the behavior of this object
will change after the first call.
"""
+ if attr == 'meta_type':
+ return cls.meta_type
# Class must be loaded if '__of__' is requested because otherwise,
# next call to __getattribute__ would lose any acquisition wrapper.
if attr in ('__class__',
@@ -154,6 +156,7 @@ class PortalTypeMetaClass(GhostBaseMetaC
if attr not in ('__module__',
'__doc__',
'__isghost__',
+ 'meta_type',
'portal_type'):
delattr(cls, attr)
# generate a ghostbase that derives from all previous bases
@@ -229,4 +232,5 @@ class PortalTypeMetaClass(GhostBaseMetaC
def generateLazyPortalTypeClass(portal_type_name):
return PortalTypeMetaClass(portal_type_name,
(InitGhostBase,),
- dict(portal_type=portal_type_name))
+ dict(portal_type=portal_type_name,
+ meta_type='ERP5 %s' % portal_type_name))
More information about the Erp5-report
mailing list