> Is there a reason for not sticking the record creation inside of its own > table?
Hi Tadeus, This is just an example. I have used it to show Massimo and others, that the simplest part of CRM application model, if you change "created_by" from type "string" to type "reference..", then there is no possibility of proper order of both tables in the model. Of course, data can be arranged in lot of other ways. If you think, that this example is wrong, maybe I should try find other one? I will think about it. Problem is, that usually you find such relation cycles in database schema, when the project is little complex, lets say, if you work with 8, 10, 15 tables. Example from CRM was pretty simple. I just want to show, that I see the problem in the fact, that if you change order of table definitions, you can make the same model legal or illegal. I think this is really wrong. If you think, that you can design every complex database model without to have a circle of relations somewhere, I don't believe you are true. If I'm true, web2py should be changed to obtain no error, when foreign key is defined earlier as the target table. If you are true, web2py should be changed to catch such error in the model in all cases, not only if order of table definitions is specific. Mirek

