On 16 November 2011 15:57, Tito Garrido <[email protected]> wrote:


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

Try:

def test(id):


> "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).:_______
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Reply via email to