Commit 1cb13cd7 authored by Jérome Perrin's avatar Jérome Perrin

use "in {}" instead of "{}.has_key" and remove some commented out LOGs


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16736 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0ad1cf82
...@@ -393,7 +393,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype): ...@@ -393,7 +393,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype):
id = '' id = ''
#LOG('before aq_portal_type %s' % id, 0, str(ptype)) #LOG('before aq_portal_type %s' % id, 0, str(ptype))
if not Base.aq_portal_type.has_key(ptype): if ptype not in Base.aq_portal_type:
# Mark as generated # Mark as generated
#prop_holder = Base.aq_portal_type[ptype] = PropertyHolder() #prop_holder = Base.aq_portal_type[ptype] = PropertyHolder()
prop_holder = PropertyHolder() prop_holder = PropertyHolder()
...@@ -744,14 +744,10 @@ class Base( CopyContainer, ...@@ -744,14 +744,10 @@ class Base( CopyContainer,
# and per class. Other uses are possible (ex. WebSection). # and per class. Other uses are possible (ex. WebSection).
ptype = self.portal_type ptype = self.portal_type
#LOG('_aq_dynamic', 0, 'self = %r, id = %r, ptype = %r' % (self, id, ptype))
#LOG("In _aq_dynamic", 0, str((id, ptype, self)))
# If this is a portal_type property and everything is already defined # If this is a portal_type property and everything is already defined
# for that portal_type, try to return a value ASAP # for that portal_type, try to return a value ASAP
if Base.aq_portal_type.has_key(ptype): if ptype in Base.aq_portal_type:
accessor = getattr(Base.aq_portal_type[ptype], id, None) accessor = getattr(Base.aq_portal_type[ptype], id, None)
#LOG('_aq_dynamic', 0, 'self = %r, id = %r, accessor = %r' % (self, id, accessor))
if accessor is not None: if accessor is not None:
# Clearly this below has a bad effect in CMFCategory. # Clearly this below has a bad effect in CMFCategory.
# Someone must investigate why. -yo # Someone must investigate why. -yo
......
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