pardon, could you explain the meaning of this code, please :

1. quantity = max(0, quantity + 1)
2. quantity = session.purchase_order.get(id, 0)

what is the 0 (zero) meaning on code above? the code is taken from web2py 
appliances pos online store, yet it work when i took the price from the 
database, while trying to modify it (the price can be input, modified by 
users) i've got the error above.

the id is the product id that want to buy, when i click the product id = 3, 
it return KeyError : 3, when i click the product id = 2, it return KeyError 
: 2.

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to