src/pyams_utils/attr.py
changeset 297 7b2ec89e3898
parent 292 b338586588ad
child 380 c062ab4db6cd
--- 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: