Skip to content

Commit

Permalink
this is it
Browse files Browse the repository at this point in the history
  • Loading branch information
sorl committed Nov 22, 2011
1 parent 1f82417 commit 1360746
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions utkik/base.py
Expand Up @@ -116,13 +116,16 @@ def get_template_names(self):
u'%s/%s.ajax.html' % fmt ] + template_names
return [ t for t in template_names if t ]

def render(self):
def render(self, template_name=None):
"""
Renders :meth:`self.get_template_names` using :meth:`get_context_data`.
Renders :meth:`self.get_template_names` using :meth:`get_context_data`,
alternatively renders a provided `template_name` template.
By default, this is called from :meth:`get_response` if the handler does
not return a response.
"""
return render_to_response(self.get_template_names(),
self.get_context_data(), RequestContext(self.request))
return render_to_response(
self.template_name or self.get_template_names(),
self.get_context_data(), RequestContext(self.request)
)

0 comments on commit 1360746

Please sign in to comment.