384 if method == 'view' and self.req.from_controller() == 'view' and \ |
384 if method == 'view' and self.req.from_controller() == 'view' and \ |
385 not '_restpath' in kwargs: |
385 not '_restpath' in kwargs: |
386 method = self.req.relative_path(includeparams=False) or 'view' |
386 method = self.req.relative_path(includeparams=False) or 'view' |
387 return self.req.build_url(method, **kwargs) |
387 return self.req.build_url(method, **kwargs) |
388 |
388 |
389 # formating methods ####################################################### |
|
390 |
|
391 def tal_render(self, template, variables): |
|
392 """render a precompiled page template with variables in the given |
|
393 dictionary as context |
|
394 """ |
|
395 from cubicweb.ext.tal import CubicWebContext |
|
396 context = CubicWebContext() |
|
397 context.update({'self': self, 'rset': self.rset, '_' : self.req._, |
|
398 'req': self.req, 'user': self.req.user}) |
|
399 context.update(variables) |
|
400 output = UStringIO() |
|
401 template.expand(context, output) |
|
402 return output.getvalue() |
|
403 |
|
404 # deprecated ############################################################### |
389 # deprecated ############################################################### |
405 |
390 |
406 @classproperty |
391 @classproperty |
407 @deprecated('[3.4] use __select__ and & or | operators') |
392 @deprecated('[3.4] use __select__ and & or | operators') |
408 def __selectors__(cls): |
393 def __selectors__(cls): |