--- a/src/pyams_utils/attr.py Tue Dec 11 09:38:24 2018 +0100
+++ b/src/pyams_utils/attr.py Fri Dec 14 18:32:37 2018 +0100
@@ -12,16 +12,11 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
-
-# import interfaces
+from pyramid.exceptions import NotFound
+from zope.interface import Interface
from zope.traversing.interfaces import ITraversable
-# import packages
from pyams_utils.adapter import ContextAdapter, adapter_config
-from pyramid.exceptions import NotFound
-from zope.interface import Interface
@adapter_config(name='attr', context=Interface, provides=ITraversable)
@@ -33,10 +28,12 @@
/path/to/object/++attr++name
- Whare *name* is the name of the requested attribute
+ Where *name* is the name of the requested attribute
"""
def traverse(self, name, furtherpath=None):
+ if '.' in name:
+ name = name.split('.', 1)
try:
return getattr(self.context, name)
except AttributeError: