move tal_render to View
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 13 Aug 2009 09:41:05 +0200
changeset 2795 59965167bef3
parent 2794 54d18916374d
child 2796 14d2c69e12c4
move tal_render to View
appobject.py
view.py
--- a/appobject.py	Thu Aug 13 09:31:34 2009 +0200
+++ b/appobject.py	Thu Aug 13 09:41:05 2009 +0200
@@ -386,21 +386,6 @@
                 method = self.req.relative_path(includeparams=False) or 'view'
         return self.req.build_url(method, **kwargs)
 
-    # formating methods #######################################################
-
-    def tal_render(self, template, variables):
-        """render a precompiled page template with variables in the given
-        dictionary as context
-        """
-        from cubicweb.ext.tal import CubicWebContext
-        context = CubicWebContext()
-        context.update({'self': self, 'rset': self.rset, '_' : self.req._,
-                        'req': self.req, 'user': self.req.user})
-        context.update(variables)
-        output = UStringIO()
-        template.expand(context, output)
-        return output.getvalue()
-
     # deprecated ###############################################################
 
     @classproperty
--- a/view.py	Thu Aug 13 09:31:34 2009 +0200
+++ b/view.py	Thu Aug 13 09:41:05 2009 +0200
@@ -151,6 +151,19 @@
         if stream is not None:
             return self._stream.getvalue()
 
+    def tal_render(self, template, variables):
+        """render a precompiled page template with variables in the given
+        dictionary as context
+        """
+        from cubicweb.ext.tal import CubicWebContext
+        context = CubicWebContext()
+        context.update({'self': self, 'rset': self.rset, '_' : self.req._,
+                        'req': self.req, 'user': self.req.user})
+        context.update(variables)
+        output = UStringIO()
+        template.expand(context, output)
+        return output.getvalue()
+
     dispatch = deprecated('[3.4] .dispatch is deprecated, use .render')(render)
 
     # should default .call() method add a <div classs="section"> around each