[web2py] Re: auth_user reference to other table

2012-04-07 Thread Anthony
Define it as Field('country', 'reference country') instead of Field('country', db.country) -- the latter won't work if db.country hasn't been defined yet. Should I use 'reference table' instead of db.table in all table definitions or just in the definition of tables that reference a

[web2py] Re: auth_user reference to other table

2012-04-06 Thread pbreit
I think you need to make sure the auth tables is created before the db.country table with this line: auth.define_tables()

[web2py] Re: auth_user reference to other table

2012-04-06 Thread pbreit
Actually, I'm not sure that is the problem. Are you getting a specific error message? Can you show the auth_user and db.country code you are using? On Friday, April 6, 2012 1:22:52 PM UTC-7, pbreit wrote: I think you need to make sure the auth tables is created before the db.country table

[web2py] Re: auth_user reference to other table

2012-04-06 Thread Anthony
i like to ask the user for his country. So I added a field country to the auth_user table. but I like it to be a referenz to db.country which I define later in the db.py file. for some reason I get an error message when trying to do that. Define it as Field('country', 'reference

[web2py] Re: auth_user reference to other table

2012-04-06 Thread Annet
Hi Anthony, Define it as Field('country', 'reference country') instead of Field('country', db.country) -- the latter won't work if db.country hasn't been defined yet. Should I use 'reference table' instead of db.table in all table definitions or just in the definition of tables that