]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add reverse_url to RequestHandler class as well
authorBret Taylor <btaylor@gmail.com>
Mon, 11 Jan 2010 19:53:21 +0000 (11:53 -0800)
committerBret Taylor <btaylor@gmail.com>
Mon, 11 Jan 2010 19:53:21 +0000 (11:53 -0800)
tornado/web.py

index 0a883205308daeab046dfc755743f0b7eedc77ff..1c4b17a0563053fbe5783eaec7d7606fd5c77d47 100644 (file)
@@ -690,6 +690,9 @@ class RequestHandler(object):
             raise Exception("You must define the '%s' setting in your "
                             "application to use %s" % (name, feature))
 
+    def reverse_url(self, name, *args):
+        return self.application.reverse_url(name, *args)
+
     def _execute(self, transforms, *args, **kwargs):
         """Executes this request with the given output transforms."""
         self._transforms = transforms
@@ -1003,6 +1006,7 @@ class Application(object):
             return self.named_handlers[name].reverse(*args)
         raise KeyError("%s not found in named urls" % name)
 
+
 class HTTPError(Exception):
     """An exception that will turn into an HTTP error response."""
     def __init__(self, status_code, log_message=None, *args):