-> mdipierro I have prepared 2 pictures, and in this time there is new post from you about company/author. Interesting that my pictures are about the same :-)
Model of your CRM application application is here: http://zvolsky.alwaysdata.net/crm1.jpg Such model can be implemented in web2py, but order of definitions is important: auth_user, company, person But let's think, you want all people from person's table can register/ login into your application. In such case you will follow web2py book, chapter 8, http://web2py.com/book/default/chapter/08, Customizing Auth & Renaming Auth Tables, and you will receive following model: http://zvolsky.alwaysdata.net/crm2.jpg And using "reference..." field types, in both definition orders (company,person or person,company) web2py will fail. As you say, I can use 'integer' type to avoid this problem, where it is. But mixing 'reference..' and 'integer' for same goal would be strange. So I can use 'integer' for all foreign keys in database. But that means in other words, that the 'reference..' field type is for nothing. What about a more difficult model as http://zvolsky.alwaysdata.net/crm3.jpg I'm sorry, this is not in english. However it is something about organization of courses, lessons, we have some teachers and partitipant here, some payments for whole course of for one lesson only, and so on. Generated web2py code from OndrejZara's web designer is here: http://zvolsky.alwaysdata.net/jekus.py And of course this code will fail in web2py, because of there is no possibility to find a proper order of table definitions. Please, think about this. The change in web2py in this direction would be great. Best regards, Mirek

