Hi Folks!

I've created some functions on my model because I need to use them often
but seems that I can't update a record using it, example of code:

"sandbox/models/db.py"

db.define_table('mytable',
    Field('myfield','string'),
    Field('state','integer')
    )
"sandbox/models/db_functions.py"def test(id):
    r=db.mytable[id]
    r.update(state=55)
"sandbox/controllers/default.py"def test_insert():
    r_id=db.mytable.insert(myfield='new field')
    test(r_id)

    return dict(r_id=r_id)


Result:
1 selected 
mytable.id<https://cryptotest2.pok.ibm.com/sandbox/appadmin/select/db?orderby=mytable.id>
mytable.myfield<https://cryptotest2.pok.ibm.com/sandbox/appadmin/select/db?orderby=mytable.myfield>
mytable.state<https://cryptotest2.pok.ibm.com/sandbox/appadmin/select/db?orderby=mytable.state>
1 <https://cryptotest2.pok.ibm.com/sandbox/appadmin/update/db/mytable/1> new
fieldNone

What am I doing wrong?

Regards,

Tito
-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

Reply via email to