[web2py] Re: define_table does not create table in database

2014-10-30 Thread Anthony
On Thursday, October 30, 2014 12:38:35 PM UTC-4, Daniel Gonzalez wrote: > > I have solved my problem. I was not properly reusing the db (DAL object) > in my library. Instead, a new DAL connection was being created in some > cases. Therefore, even though the tables were defined at the pyhton leve

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Anthony
On Thursday, October 30, 2014 11:29:26 AM UTC-4, Daniel Gonzalez wrote: > > First, it seems that migrate_enabled=False prevents not only migrations, > but also table creation (am I right here?) > Yes, as mentioned earlier and described in the documentation: http://web2py.com/books/default/chapte

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Daniel Gonzalez
I have solved my problem. I was not properly reusing the db (DAL object) in my library. Instead, a new DAL connection was being created in some cases. Therefore, even though the tables were defined at the pyhton level, auth was not really aware of it, and was trying to redefine them. Facit: mak

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Daniel Gonzalez
Getting closer to identifying my problem. It seems I am having several problems at once. First, it seems that migrate_enabled=False prevents not only migrations, but also table creation (am I right here?) Second: while trying to guess the problems with my application, I am using the test scr

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Anthony
On Thursday, October 30, 2014 7:41:07 AM UTC-4, Leonel Câmara wrote: > > Well lazy_tables=True is the default. > Actually, it does default to False, but that's not the issue here. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Anthony
See my response on Stack Overflow: http://stackoverflow.com/a/26651810/440323 > Migrate is not the problem: it does not matter if I do > migrate_enabled=False or migrate_enabled=True. > Besides, there is no table to migrate. That is the whole problem: > define_table does not create the table!

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Leonel Câmara
Well lazy_tables=True is the default. I am doing my own define_table because I have need to trigger some other > code whenever new users are created (not shown here) Well you don't need to do that because you can append a function to db.auth_user._after_insert or to auth.settings.register_ona

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Daniel Gonzalez
One more thing: you mention tables are lazy, but the documentation says they are lazy only whenever DAL(...,lazy_tables=True) is set (DAL documentation ) Which one is right? -- Resources: - http

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Daniel Gonzalez
Thanks for your reply, Migrate is not the problem: it does not matter if I do migrate_enabled=False or migrate_enabled=True. Besides, there is no table to migrate. That is the whole problem: define_table does not create the table! I am doing my own define_table because I have need to trigger so

[web2py] Re: define_table does not create table in database

2014-10-30 Thread Leonel Câmara
Well the tables are lazy, but that shouldn't cause your problem because once you use them they really get defined. May I ask why you are defining your own user table instead of using auth.define_tables()? Anyway, your problem is caused by migrate_enabled=False. -- Resources: - http://web2py.co