[Checkins] SVN: grok/branches/regebro-guido-templates/src/grok/components.py Updated the PageTemplate support to support the push-story.

Lennart Regebro regebro at gmail.com
Thu Oct 4 11:17:58 EDT 2007


Log message for revision 80619:
  Updated the PageTemplate support to support the push-story.
  

Changed:
  U   grok/branches/regebro-guido-templates/src/grok/components.py

-=-
Modified: grok/branches/regebro-guido-templates/src/grok/components.py
===================================================================
--- grok/branches/regebro-guido-templates/src/grok/components.py	2007-10-04 15:07:45 UTC (rev 80618)
+++ grok/branches/regebro-guido-templates/src/grok/components.py	2007-10-04 15:17:58 UTC (rev 80619)
@@ -233,14 +233,13 @@
 
     def _factory_init(self, factory):
         factory.macros = self.macros
+
+    def getDefaultVariables(self):
+        return {}
         
-    def _render_template(self, view):
+    def render_template(self, view):
         namespace = self.pt_getContext()
-        namespace['request'] = view.request
-        namespace['view'] = view
-        namespace['context'] = view.context
-        # XXX need to check whether we really want to put None here if missing
-        namespace['static'] = view.static
+        namespace.update(view.getDefaultVariables())        
         return self.pt_render(namespace)
     
 
@@ -262,13 +261,12 @@
     def _factory_init(self, factory):
         factory.macros = self.macros
 
-    def _render_template(self, view):
+    def getDefaultVariables(self):
+        return {}
+    
+    def render_template(self, view):
         namespace = self.pt_getContext()
-        namespace['request'] = view.request
-        namespace['view'] = view
-        namespace['context'] = view.context
-        # XXX need to check whether we really want to put None here if missing
-        namespace['static'] = view.static
+        namespace.update(view.getDefaultVariables())
         return self.pt_render(namespace)
 
     



More information about the Checkins mailing list