I think you just need to make sure that each model you refer get defined before it get refer. Since web2py parse model files in alphanumeric you have to make sure the model file that contain your table definition is at the right place. I am not sure how web2py parse the sub-folder, it may parse all the models/files.py and then parse the sub-folder in alphanumeric order and so on. But as I said I am not sure about that, more reading or little dummy test could let you figure how web2py parse the models/ folder and sub-folders.
Richard On Thu, Oct 18, 2012 at 4:12 PM, Don_X <don.clerm...@gmail.com> wrote: > > > Thank you gentlemen for your input ! > > Niphlod .. i understood the flow logic from the start .. even before I > tried it, that is why I tried it ! > > ... what kept my attention is the response above yours ! > > The flow logic was easy to comprehend ! ... but : > > It seems From Marin's answer, the tables had to be created before the > shuffle ( i.e moving the additional "db.define_table " to subdirectories > of MODELS ) which I did not do ... I deleted the db and created a new db > with no tables ! > > and .. if I have tables in that shufles that are referencing other tables, > the table refered to have to exist in the db .. ! ... so the lesson learned > here is : to go back to my previous flow ..let the app run at least once > ... so the db and all the necessary tables get created .. and only then .. > I can do on and seperate my db.py file into 4 different files under 4 > different sub directories with their related controller actions defined ! > ... > > there is no where that was explained that way ... the flow logic was > properly explain in different threads here .. but did not mentionned that > the tables had to exist before ! ... i thought the tables would have been > created just like before when everything was in the main MODELS directory > under one file ( db.py ) > > OK .. let me do some more cooking and see ! ... > > thanks .. and thank you Marin ! > > Don > > -- > > > > --