Skip to content
Myr

Refactored the @route decorator to use the new add_url_rule method.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Tagged add_url_rule with versionadded of 0.2

authored by cgrinds · committed by Armin Ronacher · parent 3088a93 · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:flask.py+3 added-2 removed
506 unmodified lines
507 endpoint508 :param view_func: the function to call when servicing a request to the provided endpoint509 :param options: the options to be forwarded to the underlying510 :class:`~werkzeug.routing.Rule` object511512 .. versionadded:: 0.2513 """514 options['endpoint'] = endpoint515 options.setdefault('methods', ('GET',))516 self.url_map.add(Rule(rule, **options))
65 unmodified lines
582 :param options: other options to be forwarded to the underlying583 :class:`~werkzeug.routing.Rule` object.584 """585 def decorator(f):584 self.add_url_rule(rule, f.__name__, **options)585 self.view_functions[f.__name__] = f586 self.add_url_rule(rule, f.__name__, f, **options)587 return f588 return decorator589590 def errorhandler(self, code):
182 unmodified lines