[Checkins] SVN: z3c.pt/trunk/ Fixed previous commit.

Malthe Borch mborch at gmail.com
Tue Mar 10 09:45:54 EDT 2009


Log message for revision 97801:
  Fixed previous commit.

Changed:
  U   z3c.pt/trunk/CHANGES.txt
  U   z3c.pt/trunk/src/z3c/pt/expressions.py

-=-
Modified: z3c.pt/trunk/CHANGES.txt
===================================================================
--- z3c.pt/trunk/CHANGES.txt	2009-03-10 13:20:03 UTC (rev 97800)
+++ z3c.pt/trunk/CHANGES.txt	2009-03-10 13:45:53 UTC (rev 97801)
@@ -1,11 +1,10 @@
 Changelog
 ---------
 
-1.0b13 (Unreleased)
-~~~~~~~~~~~~~~~~~~~
+In next release
 
 - Path expressions give preference to dictionary items instead of
-  dictionary attributes. [sidnei]
+  dictionary attributes. [sidnei, malthe]
 
 1.0b12 (2009/03/09)
 ~~~~~~~~~~~~~~~~~~~

Modified: z3c.pt/trunk/src/z3c/pt/expressions.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/expressions.py	2009-03-10 13:20:03 UTC (rev 97800)
+++ z3c.pt/trunk/src/z3c/pt/expressions.py	2009-03-10 13:45:53 UTC (rev 97801)
@@ -61,17 +61,21 @@
 
                 # special-case dicts for performance reasons
                 if isinstance(base, dict):
-                    base = base[name]
+                    next = base.get(name, _marker)
+
+                    if next is _marker:
+                        next = getattr(base, name, _marker)
                 else:
                     next = getattr(base, name, _marker)
-                    if next is not _marker:
-                        base = next
-                        if ns is True and isinstance(base, MethodType):
-                            base = base()
-                        continue
-                    else:
-                        base = traversePathElement(
-                            base, name, path_items, request=request)
+                
+                if next is not _marker:
+                    base = next
+                    if ns is True and isinstance(base, MethodType):
+                        base = base()
+                    continue
+                else:
+                    base = traversePathElement(
+                        base, name, path_items, request=request)
 
                 if not isinstance(base, (basestring, tuple, list)):
                     base = self.proxify(base)



More information about the Checkins mailing list