[Checkins] SVN: z3c.pt/trunk/ Do not bind template to a trivial instance.

Malthe Borch mborch at gmail.com
Wed Feb 25 11:18:28 EST 2009


Log message for revision 97268:
  Do not bind template to a trivial instance.

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

-=-
Modified: z3c.pt/trunk/CHANGES.txt
===================================================================
--- z3c.pt/trunk/CHANGES.txt	2009-02-25 15:43:52 UTC (rev 97267)
+++ z3c.pt/trunk/CHANGES.txt	2009-02-25 16:18:27 UTC (rev 97268)
@@ -1,6 +1,10 @@
 Changelog
 ---------
 
+In next release
+
+- Do not bind template to a trivial instance. [malthe]
+
 1.0b10 (2009/02/24)
 ~~~~~~~~~~~~~~~~~~~
 

Modified: z3c.pt/trunk/src/z3c/pt/pagetemplate.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2009-02-25 15:43:52 UTC (rev 97267)
+++ z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2009-02-25 16:18:27 UTC (rev 97268)
@@ -145,8 +145,10 @@
     Initialize with a template string."""
 
     def __get__(self, instance, type):
-        return self.bind(instance)
-
+        if instance is not None:
+            return self.bind(instance)
+        return self
+    
 class PageTemplateFile(BaseTemplateFile, PageTemplate):
     """Page Templates using TAL, TALES, and METAL.
 



More information about the Checkins mailing list