"Menu management documentation"

This commit is contained in:
Doug Le Tough 2017-11-25 21:21:05 +01:00
parent d9ecf3bb5a
commit b503c7887f
1 changed files with 14 additions and 2 deletions

View File

@ -26,7 +26,15 @@ app.secret_key = 'ce1d1c9ff0ff388a838b3a1e3207dd27'
db = SQLAlchemy(app)
########################################################################
# Menu management
# Menu management:
# ----------------
#
# The main menu is a list of lists in the followin format
# [string caption, string URL endpoint, int 0]
# - The URL end point MUST match the function called by the corresponding
# route.
# - The int 0 is used to determine which menu entry is actally called.
# The value MUST be 0.
########################################################################
def get_menu(page):
@ -52,7 +60,11 @@ def get_menu(page):
return menu
########################################################################
# Routes
# Routes:
# -------
#
# Except for the index fonction, the function name MUST have the same
# name than the URL endpoint to make the menu work properly
########################################################################
@app.errorhandler(404)
def page_not_found(e):