[web2py] Re: Menus in the model don't update at the right time...
The web2py request work flow runs the model files first, then the controller, then renders the view. I had a similar problem, the only way I could figure out how to change the menu after the model files have run was to add a menu update function to the model and call it from the controller when necessary.
[web2py] Re: Menus in the model don't update at the right time...
On Wednesday, April 27, 2011 12:39:41 PM UTC-4, encompass wrote: It's a bummer, but I currently have to refresh the page after adding an item to the menus with a database insert. Is there any way I can have the menu's refresh manually before any page rendered? Maybe put a menu update function in a model file and then call it from your layout.html view. Or perhaps you could turn the menu into a component and insert it via LOAD (with our without Ajax). Anthony