From: Bret Taylor Date: Mon, 11 Jan 2010 19:53:21 +0000 (-0800) Subject: Add reverse_url to RequestHandler class as well X-Git-Tag: v1.0.0~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9107b6be2bffe4bcaf8cd47cf79c6d792cdf71d4;p=thirdparty%2Ftornado.git Add reverse_url to RequestHandler class as well --- diff --git a/tornado/web.py b/tornado/web.py index 0a8832053..1c4b17a05 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -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):