[web2py] Re: KeyError on select after an insert()

2010-03-05 Thread mdipierro
this db.TABLENAME.id[id] = dict(field=value,field=value) should be db.TABLENAME[id] = dict(field=value,field=value) if id is 0, this is create and if is>0 this is update. On Mar 5, 12:47 am, compassiontara wrote: > Thank you! > > Mengu on irc helped make me all smart as well. > >

[web2py] Re: KeyError on select after an insert()

2010-03-04 Thread compassiontara
Thank you! Mengu on irc helped make me all smart as well. For completeness sakes in case someone else gets as dumb as me, a very very quick reference, based on what I've learned today. #make the DB. db.define_table('tablename',Field('fieldname','type',options) INSERT: db.TABLENAME.inse

[web2py] Re: KeyError on select after an insert()

2010-03-04 Thread mdipierro
It is not >>> db().select(db.test.id>0) but >>> db(db.test.id>0).select() db(condition).select(*fields,orderby=..,groupby=...,limitby=...,cache=...,distinct=...) On Mar 4, 5:26 pm, compassiontara wrote: > Hi everyone.  I'm having an issue with select() working after an > insert. > > See below