Commits

Steve Losh committed 64c26ed

Add the actual functionality, lol.

  • Participants
  • Parent commits f2ca66a

Comments (0)

Files changed (1)

File flaskext/urls.py

     :copyright: (c) 2010 by Steve Losh.
     :license: MIT, see LICENSE for more details.
 """
+
+from flask import url_for
+from werkzeug.routing import BuildError
+
+def permalink(function):
+    def inner(*args, **kwargs):
+        endpoint, values = function(*args, **kwargs)
+        try:
+            return url_for(endpoint, **values)
+        except BuildError:
+            return
+    return inner
+
+