we2admin tables

55 views
Skip to first unread message

Maurice Waka

unread,
Jun 21, 2017, 6:00:32 AM6/21/17
to web2py-users
Its nice to use web2admin to manage groups, permissions etc. 
I note that i have another table created:
dbhome = DAL('sqlite://healthhome.db', folder='/home/name/web2py')
dbhome.define_table('home', Fields...)

I cant see this table in the web2admin tables shown, and I want to add permissions to it.
Please assist
Regards

黄祥

unread,
Jun 21, 2017, 7:00:14 AM6/21/17
to web2py-users
i think you can add permission with 
auth.add_permission()

Anthony

unread,
Jun 21, 2017, 11:32:13 AM6/21/17
to web2py-users
Are you talking about https://github.com/rif/web2admin? If so, in a model file that runs after the plugin's model file, you can do:

plugins.web2admin.dbs = (db, dbhome)

The default value for the above is set to (db, ) at https://github.com/rif/web2admin/blob/master/models/plugin_web2admin/plugin_web2admin.py#L44, but you can add additional dbs.

Note, though, that it expects Auth to be in the first db listed, and functionality related to Auth is limited to the first db listed. If dbhome is your only database or the primary database, then list it first.

Anthony

Maurice Waka

unread,
Jun 22, 2017, 6:31:09 AM6/22/17
to web...@googlegroups.com

I did insert plugins.web2admin.dbs = (db, dbhome
in the db.py model but still cant get to see the dbhome table 


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/IfpGixvus88/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Jun 22, 2017, 10:35:51 AM6/22/17
to web2py-users
On Thursday, June 22, 2017 at 6:31:09 AM UTC-4, Maurice Waka wrote:

I did insert plugins.web2admin.dbs = (db, dbhome
in the db.py model but still cant get to see the dbhome table 

As noted, that line must go in a model file that runs after the plugin's model file. Given that the "plugins" object isn't even defined yet, including that line in db.py should result in an exception.

Anthony

Ron Chatterjee

unread,
Jun 22, 2017, 11:20:03 PM6/22/17
to web2py-users

Maurice Waka

unread,
Jun 23, 2017, 4:12:06 AM6/23/17
to web...@googlegroups.com
I I'll give it a try @ron

On Jun 23, 2017 06:20, "Ron Chatterjee" <achatte...@gmail.com> wrote:
Does this help?

http://www.web2pyslices.com/slice/show/2018/plugin-manage-groups

Maurice Waka

unread,
Jun 23, 2017, 8:48:40 AM6/23/17
to web...@googlegroups.com
I find wrb2admin easier to understand and use. Is there a simplified way/explanation on how to use after installing. e.g. Www.vimeo.com/60895953
Regards 

On Jun 23, 2017 06:20, "Ron Chatterjee" <achatte...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages