Thanks for the replies. All is working OK now. Not sure what was happening
yesterday. I think I was just having one of those days...
In case anyone else comes across this thread - the advice below is good: use
a normal shell and make sure to do a db.commit()
On 19 March 2011 14:25, rochacbruno
In shell you need to fire db.commit() to persist changes.
Em 19/03/2011, às 10:23, Tom Atkins escreveu:
> Hmm - I spoke too soon. Database changes work OK from controllers but not
> from shell...
>
> On 19 March 2011 13:03, Tom Atkins wrote:
> Oops - my mistake - I was using Navicat to lo
Are you using the web-based shell in admin? If so, try a regular Python
shell instead -- the admin shell seems to have some limitations.
On Saturday, March 19, 2011 9:23:37 AM UTC-4, Tom A wrote:
> Hmm - I spoke too soon. Database changes work OK from controllers but not
> from shell...
>
> O
Hmm - I spoke too soon. Database changes work OK from controllers but not
from shell...
On 19 March 2011 13:03, Tom Atkins 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 Atki
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 wrote:
> Thanks Massimo - I was considering using accessible_query.
>
> However, I've now got a problem before I try that - auth.add_permi
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 thi
The book says 'db(accessible_query(...)...' -- should it say 'db(auth.
accessible_query(...)...'?
http://web2py.com/book/default/chapter/08?search=accessible_query
On Friday, March 18, 2011 4:08:18 PM UTC-4, Massimo Di Pierro wrote:
> If you have given explicit permission to the group:
>
> g
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_us
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! ;-)
That should be:
for user in users: #2nd plural
I would think a join could get you there in one query. Something like:
users = db((db.auth_user.id==db.auth_membership.user_id) &
(db.auth_membership.group_id==db.auth_group.id) &
(db.auth_group.role=='Super admin')).select()
for user in user:
#do something
The
11 matches
Mail list logo