I don't understand where is the problem? Can you describe it again or better?
Web2py adds id field into all tables as primary key, field of type 'reference tablename' or db.tablename became foreign keys. This is standard behaviour. If you want/need to modify this behaviour, you should read about 'legacy tables' in chapter 6 of webpy.com/book. Dne pátek 3. června 2016 12:27:29 UTC+2 botass...@gmail.com napsal(a): > > Hello. > > I have 3 tables, one of them default auth_user table, and other two are: > db.define_table('table_A', > Field('account_user', 'reference auth_user', readable= > False), > Field('username', > requires=IS_NOT_EMPTY(error_message=auth.message.is_empty)), > Field('password', requires= > IS_NOT_EMPTY(error_message=auth.message.is_empty)), > Field('t_server', requires= > IS_NOT_EMPTY(error_message=auth.message.is_empty)), > format='%(username)s_%(t_server)s' > ) > db.define_table('table_B', > Field('account_username', 'reference table_A'), > Field('some_field', requires= > IS_NOT_EMPTY(error_message=auth.message.is_empty)), > format='%(some_field)s' > ) > when insertion in second table is alright, but i try to insert into third > table, i'm getting - no such column: table_A.id. > code of insertion: > db.table_B.insert( > account_username=db.table_A.id, > some_field='some_text' > ) > > in sql log there is generated 'id' field which is primary key, and my > field 'account_username' is created with reference to table_A (id) > > What I'm doing wrong? > -- 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 the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.