# HG changeset patch # User Sylvain Thénault # Date 1250149265 -7200 # Node ID 59965167bef3d4b525380b7742dcdb70c7b180ed # Parent 54d18916374dfdaa788cd219b9352606ceb735c0 move tal_render to View diff -r 54d18916374d -r 59965167bef3 appobject.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 diff -r 54d18916374d -r 59965167bef3 view.py --- 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
around each