renamed ClearMessage to better name of ClearStatus, and exposed it to jinja2 so status messages now work in base.html
This commit is contained in:
6
main.py
6
main.py
@@ -26,6 +26,12 @@ db = SQLAlchemy(app)
|
|||||||
ma = Marshmallow(app)
|
ma = Marshmallow(app)
|
||||||
Bootstrap(app)
|
Bootstrap(app)
|
||||||
|
|
||||||
|
|
||||||
|
####################################### GLOBALS #######################################
|
||||||
|
# allow jinja2 to call these python functions directly
|
||||||
|
app.jinja_env.globals['ClearStatus'] = st.ClearStatus
|
||||||
|
|
||||||
|
|
||||||
@app.route("/test", methods=["GET"])
|
@app.route("/test", methods=["GET"])
|
||||||
def test():
|
def test():
|
||||||
return render_template("base.html", alert=st.GetAlert(), message=st.GetMessage())
|
return render_template("base.html", alert=st.GetAlert(), message=st.GetMessage())
|
||||||
|
|||||||
Reference in New Issue
Block a user