On Wednesday, February 20, 2013 1:10:32 AM UTC-5, 黄祥 wrote:

> thank you so much for your hints anthony.
> actually i'm still confuse about session.order.get(id, 0), on book only 
> have connect, secure and forget, so that i'm so lack of information what is 
> session can do.
>

session is a Storage object, which inherits from dict and therefore has all 
the dict methods. The .get(key, default=None) method is a dict method 
(i.e., it is not a special method of Storage, which is why it is not 
explicitly documented) -- it simply gets the value associated with key, and 
if key does not exist, it returns default. So, session.order.get(id, 0)returns 
0 if the requested key doesn't exist in session.order.

Anthony

-- 

--- 
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