I think most of what I need is in ch. 3 about the DAL, but using this, I don't think there are any records with "manager" in them, so I am puzzled why I am locked out. python web2py.py -a 'your password' -i 127.0.0.1 -p 8000 gets in without gui
>>> myrecord = db(db.auth_group.id==0).select().first() >>> print myrecord None >>> myrecord = db(db.auth_group.id==0).select().first() >>> print myrecord None >>> myrecord = db(db.auth_membership.id==0).select().first() >>> print myrecord None In any case, I had a backup of my app, so I can try again to add the manager group to a restored copy. On Tuesday, September 11, 2012 3:53:56 PM UTC-5, greaneym wrote: > > Got farther but still stuck. I got locked out of the database and am > trying to get back in with "admin". > > cd to directory that contains "web2py.py" > > python web2py.py -S appname > > >>> > >>> db = DAL('sqlite://storage.sqlite', auto_import=True) > >>> print db.tables > ['auth_cas', 'auth_event', 'auth_group', 'auth_membership', > 'auth_permission', 'auth_user', 'plugin_google_checkout_message', > 'plugin_google_checkout_order', 'plugin_google_checkout_purchase', > 'product', 'sale'] > > > if you leave out "auto_import=True" you will see [] as the result of > print db.tables. > > >>> print db.auth_cas.fields > ['id', 'user_id', 'created_on', 'service', 'ticket', 'renew'] > > print db.auth_membership.fields > > ['id', 'user_id', 'group_id']] > > > I need help with the finding the rest. > > >>> rows = db(db.auth_membership.group_id).select() > >>> print rows > auth_membership.id,auth_membership.user_id,auth_membership.group_id > > > = db(db.auth_group).select() > >>> print rows > auth_group.id,auth_group.role,auth_group.description > > >>> rows = db(db.auth_group.role).select() > >>> print rows > auth_group.id,auth_group.role,auth_group.description > > > How do I find out where the "manager" group is, and can/should I add > "admin" > to it, and how is this done? > > thanks for any assistance. > > > On Tuesday, September 11, 2012 10:32:47 AM UTC-5, Massimo Di Pierro wrote: >> >> I do not understand this line: >> >> python web2py.py -S app -M -N -R applications/myapp -A >> >> -R should specify a script, not an app >> -A should be followed by command line arguments for the script but you do >> not have any >> >> This is probably not the cause of your problem anyway. >> >> >> >> On Tuesday, 11 September 2012 09:48:48 UTC-5, greaneym wrote: >>> >>> Dear all, >>> >>> I'm testing the pos plugin and have it mostly set up, but I'm stuck. I >>> had commented all the auth statements and have now uncommented them, and >>> was adding the group called manager and before I could add members was >>> interrupted. My session ended, and after that I could not use the admin >>> interface to access the database from appadmin. So I'm now trying to add >>> members through the shell, but >>> I'm getting an error: >>> >>> python web2py.py -S app -M -N -R applications/myapp -A >>> Traceback (most recent call last): >>> File "web2py.py", line 16, in <module> >>> import gluon.widget >>> ImportError: No module named gluon.widget >>> >>> >>> I upgraded from version 1.99 to 2.06 and just added the web2py.app. >>> >>> Do I need something else? Or how can I modify the shell command please? >>> >>> thanks, >>> Margaret >>> >>> --