[Erp5-report] r17067 - /erp5/trunk/products/ERP5Type/Base.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Oct 21 02:33:48 CEST 2007
Author: yo
Date: Sun Oct 21 02:33:48 2007
New Revision: 17067
URL: http://svn.erp5.org?rev=17067&view=rev
Log:
Fasten _aq_dynamic a bit.
Modified:
erp5/trunk/products/ERP5Type/Base.py
Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=17067&r1=17066&r2=17067&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Sun Oct 21 02:33:48 2007
@@ -746,17 +746,11 @@
# If this is a portal_type property and everything is already defined
# for that portal_type, try to return a value ASAP
- if ptype in Base.aq_portal_type:
- accessor = getattr(Base.aq_portal_type[ptype], id, None)
- if accessor is not None:
- # Clearly this below has a bad effect in CMFCategory.
- # Someone must investigate why. -yo
- #return accessor.__of__(self) # XXX - JPS: I have no idea if we should __of__ before returning
- return accessor
- return None
- elif id in ('portal_types', 'portal_url', 'portal_workflow'):
- # This is required to precent infinite loop (we need to access portal_types tool)
- return None
+ try:
+ return getattr(Base.aq_portal_type[ptype], id, None)
+ except KeyError:
+ if id.startswith('portal_'):
+ return None
# Proceed with property generation
klass = self.__class__
More information about the Erp5-report
mailing list