summaryrefslogtreecommitdiff
path: root/app/views.py
diff options
context:
space:
mode:
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)