"Menu management documentation"
This commit is contained in:
		
							parent
							
								
									d9ecf3bb5a
								
							
						
					
					
						commit
						b503c7887f
					
				| @ -26,7 +26,15 @@ app.secret_key = 'ce1d1c9ff0ff388a838b3a1e3207dd27' | |||||||
| db = SQLAlchemy(app) | 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): | def get_menu(page): | ||||||
| @ -52,7 +60,11 @@ def get_menu(page): | |||||||
|   return menu |   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) | @app.errorhandler(404) | ||||||
| def page_not_found(e): | def page_not_found(e): | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user