In shell you need to fire db.commit() to persist changes.
Em 19/03/2011, às 10:23, Tom Atkins <minkto...@gmail.com> escreveu: > Hmm - I spoke too soon. Database changes work OK from controllers but not > from shell... > > On 19 March 2011 13:03, Tom Atkins <minkto...@gmail.com> wrote: > Oops - my mistake - I was using Navicat to look at my sqllite database and > had left it open. hence sqllite db was locked. > > > On 19 March 2011 10:41, Tom Atkins <minkto...@gmail.com> wrote: > Thanks Massimo - I was considering using accessible_query. > > However, I've now got a problem before I try that - auth.add_permission > doesn't seem to be working: > > >>>> auth.add_permission(1, 'read', db.auth_user, 0) > 1 > > but when I look in the auth_permission table there are no entries. I've > tried this with alternative syntax: > > >>>> auth.add_permission(1, 'read', db.auth_user) > 2 > > and tried other tables: > > >>>> auth.add_permission(1, 'read', db.post) > 3 > > but still no entries in auth_permission. Any ideas? > > > On 18 March 2011 20:08, Massimo Di Pierro <massimo.dipie...@gmail.com> wrote: > If you have given explicit permission to the group: > > group_id=auth.add_group('Super Admin') > auth.add_permission(group_id, 'read', db.mytable) > > then you can do: > > for row in db(auth.accessible_query('read', > db.mytable)).select(db.mytable.ALL): print row > > in the case being discussed mytable is auth_user > > On Mar 18, 2:38 pm, Tom Atkins <minkto...@gmail.com> wrote: > > Thank you - yes the double hit on the database was what made it seem > > inelegant to me. > > > > Your joined query works fine and I can work with the return data. Any > > further improvements gratefully received! Hoping Massimo has an undocumented > > super 1 liner! ;-) > > >