It is not a migration issue. Your tables are created and I am sure
they do appear in appadmin. The problem is that the line
table.table_name.requires = IS_IN_SET(self.db.tables)
is wrong because self.db.tables it is evaluated BEFORE web2py sees
that your tables are defined. A temporary solutions to this problem
would be to add
try:
auth.settings.table_permission.table_name.requires=IS_IN_SET(db.tables)
except: pass
at the top of appadmin or at the bottom of your model.
A better solution would be to allow lazy evaluation of validator
arguments. I will think about this. Anybody has a better solution?
On Jun 27, 2:49 pm, Kuba Kucharski <[email protected]> wrote:
> THE PROBLEM IS ABOUT APPADMIN AND RENDERING DEFAULT CRUD ON
> AUTH_PERMISSION TABLE.
>
> to reproduce:
> 1: initialize new app
> 2: add a table in db.py
> 3: go here:http://127.0.0.1:8001/app/appadmin/insert/db/auth_permission
> and check whether you can assign permissions to your new table in
> dropbox(table name)
>
> Description
> In gluon/tools.py there is a line:
> table.table_name.requires = IS_IN_SET(self.db.tables)
>
> this is the fragment about creating auth_permission
> but this makes only 4 auth tables visible in DROPBOXES, not my own tables
>
> still in console:
> print db.tables
> ['auth_user', 'auth_group', 'auth_membership', 'auth_permission',
> 'auth_event', 'cstom_table1, 'cstom_table2']
>
> is it a bug(limitation in appadmin) or am I missing something? should
> I somehow trigger auth migration?
> but when I do "migrate" it DOES NOT help:
> auth.define_tables(migrate=True)
>
> --
> Kuba