From b503c7887f7a5b5f1e35dcc7fbdb3bbadedc6198 Mon Sep 17 00:00:00 2001 From: Doug Le Tough Date: Sat, 25 Nov 2017 21:21:05 +0100 Subject: [PATCH] "Menu management documentation" --- tetawebapp/tetawebapp.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tetawebapp/tetawebapp.py b/tetawebapp/tetawebapp.py index 8394307..2c6978a 100755 --- a/tetawebapp/tetawebapp.py +++ b/tetawebapp/tetawebapp.py @@ -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):