diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2013-04-12 01:32:37 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2013-04-12 01:32:37 +0200 |
commit | abfc1005db0f256ca60823f61b8a904304eb9a4c (patch) | |
tree | 87c1f13512cae335759d9bf43dab7fc60c3afec0 /app/views.py | |
parent | 978f1a4999937a56bd3861a219bb2d9082ba5de6 (diff) | |
download | kosten-abfc1005db0f256ca60823f61b8a904304eb9a4c.tar.gz kosten-abfc1005db0f256ca60823f61b8a904304eb9a4c.tar.bz2 kosten-abfc1005db0f256ca60823f61b8a904304eb9a4c.zip |
In Flask/Jinja: Show / Categories
Diffstat (limited to '')
-rw-r--r-- | app/views/__init__.py (renamed from app/views.py) | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/app/views.py b/app/views/__init__.py index accbeb5..dc662ec 100644 --- a/app/views.py +++ b/app/views/__init__.py @@ -1,7 +1,7 @@ from flask import render_template, request, url_for import flask -from . import app, db +from .. import app, db # check for mobile visitors mobile_checks = ["J2ME", "Opera Mini"] @@ -12,21 +12,22 @@ def handle_mobile(): flask.g.is_mobile = any((x in ua) for x in mobile_checks) - @app.template_filter("static_url") def static_url(s): return url_for("static", filename=s) +@app.template_filter("eur") +def eur(s): + return ("%s EUR" % s) @app.errorhandler(404) def page_not_found (error): return render_template("404.jinja", page = request.path), 404 -@app.route("/") -@app.route("/index") -def index(): - return render_template("root.jinja") +from . import categories, consts, expenses + +app.register_blueprint(expenses.mod) +app.register_blueprint(consts.mod, url_prefix="/const") +app.register_blueprint(categories.mod, url_prefix="/cat") -@app.route("/add") -def addExp(): - return render_template("root.jinja") +app.add_url_rule("/", endpoint = "index", build_only = True) |