You have different ways:
if request.function!='maintenance':
try:
db = DAL('sqlite://storage.sqlite')
except:
redirect(URL('default', 'maintenance'))
else: db = None
But then you need to check (if db) every time you use db in models.
You can use conditional models:
- Move all your models under a models/default/ subfolder so they only run
when the default.py controller is executed.
- Put the maintenance action in a different controller
Make another app that only reports maintenance issues and redirect to an
action in the other app.
On Monday, October 8, 2012 12:17:28 PM UTC-5, Jose wrote:
>
>
>
> El lunes, 8 de octubre de 2012 14:01:44 UTC-3, Massimo Di Pierro escribió:
>>
>> Why did you get a cycle?
>>
>
> Because when you redirect to the maintenance, run again the model
> (connection to the database)
>
> Jose
>
--