Our friend Paolo has contributed a private patch that changes an incorrect web2py/pydal behavior.
Currently pydal treats id==0 the same as id==None. That means for example that table[0] = record is an insert, not an update. People may have used this in APIs
def post_in_table():
table[request.args(0)] = request.vars
# post_in_table/0?key=value does insert
# post_in_table/1?key=value does update of id==1
Paolo pointed out that id can be 0 in some database and therefore id==0 should be treated as a possible valid id.
I think he is right but this would be a backward incompatible change. What do people think about changing this behavior?
Massimo