Hi,

I thought this could be trivial but so far I couldn't figure out how to.
All I need to do is have a global variable in default.py. When I call one 
method it will store a value in this variable, and later another method 
will use it. What I have is something like this:


------- default.py-----
value = 0


def saveValue():
        global value
        value = 1

        
def showValuel():
        return dict(entries=value)

Then I thought the default.py module maybe going out of scope when the 
method returns, so I put 'value' in db.py, since variables defined in db.py 
are available globally. But I still get the value that I define in db.py, 
not the modified value in saveValue().

Could you please tell me if there is a recommended way in web2py to 
have global values?

Thank you.

Reply via email to