On 5 Aug 2013, at 2:32 PM, Dragan Matic <[email protected]> wrote:
> Let's suppose that I want to disable my web app for a certain period of time 
> while I am updating the database and that I want to inform users that 
> maintenance is in progress? 
> 1. In models I can create a global var MAINTENANCE_IN_PROGRESS = False which 
> I could thange to True when I want to do some maintenance tasks. 
> 2. then in every function in every controller I could write something like:
> 
> def controller():
>     if MAINTENANCE_IN_PROGRESS:
>         Redirect_to_maintenance_message
>     else:
>        #do_controller_task
> 
> Is there some smarter way to do it without checking if maintenance is in 
> progress in every function?

You can edit request (in your model) to go to a maintenance 
controller+function, assuming you can live with a single function.

Alternatively, you could save the old controller+function in request and let 
your maintenance function look at it and be smarter (if necessary).

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to