Include a small comment on this optimization.
This commit is contained in:
parent
e2fca426d9
commit
8b85633bfe
|
@ -177,12 +177,15 @@ class DexterityContent(DAVResourceMixin, PortalContent, DefaultDublinCoreImpl, C
|
|||
description = u''
|
||||
|
||||
def __getattr__(self, name):
|
||||
# attribute was not found; try to look it up in the schema and return
|
||||
# a default
|
||||
|
||||
# optimization: sometimes we're asked for special attributes
|
||||
# such as __conform__ that we can disregard (because we
|
||||
# wouldn't be in here if the class had such an attribute
|
||||
# defined).
|
||||
if not name.startswith('__'):
|
||||
raise AttributeError(name)
|
||||
|
||||
# attribute was not found; try to look it up in the schema and return
|
||||
# a default
|
||||
schema = SCHEMA_CACHE.get(self.portal_type)
|
||||
if schema is not None:
|
||||
field = schema.get(name, None)
|
||||
|
|
Reference in New Issue