[web2py] Re: Ver 2.3.2 changes the order models are loaded.
That probably wasn't the right change. I think it should put the subfolders in alphabetical order and then run the files within each folder in alphabetical order (that's roughly how it worked prior to the change, but alphabetical ordering of the subfolders was not guaranteed). Anthony On Thursday, December 20, 2012 1:12:20 PM UTC-5, Jim Karsten wrote: I have database tables defined in models/db.py. I have a controller-specific model defined in a models/client subdirectory. Ver 2.3.2 loads the models in a different order from ver 2.2.1. Ver 2.2.1 models/0.py models/db.py models/clients/edit/db.py Ver 2.3.2 models/0.py models/clients/edit/db.py models/db.py The models/clients/edit/db.py depends on variables defined in modes/db.py so I get errors with Ver 2.3.2 The sort=False argument was removed from the listdir call in this line of gluon/compileapp.py def run_models_in() models = listdir(path, '^\w+\.py$', 0, sort=False) # Ver 2.2.1 models = listdir(path, '^\w+\.py$', 0) # Ver 2.3.2 If I restore that, it works again. The issue was discussed here: https://groups.google.com/d/topic/web2py/ZfI7K9jW45w/discussion In Ver 2.2.1, files in the models directory are first loaded in alphabetically order. Then each subfolder is handled in order, model files in subfolders are loaded in alphabetical order. In Ver 2.3.2, all models are sorted by path name and then loaded in that order. I can rename subfolders so they are loaded properly but before I change anything I'd like to make sure the effects of dropping sort=False were intended. --
[web2py] Re: Ver 2.3.2 changes the order models are loaded.
I agree with Anthony. The fix was wrong. I will write a patch if he does not send me one first. Massimo On Thursday, 20 December 2012 12:12:20 UTC-6, Jim Karsten wrote: I have database tables defined in models/db.py. I have a controller-specific model defined in a models/client subdirectory. Ver 2.3.2 loads the models in a different order from ver 2.2.1. Ver 2.2.1 models/0.py models/db.py models/clients/edit/db.py Ver 2.3.2 models/0.py models/clients/edit/db.py models/db.py The models/clients/edit/db.py depends on variables defined in modes/db.py so I get errors with Ver 2.3.2 The sort=False argument was removed from the listdir call in this line of gluon/compileapp.py def run_models_in() models = listdir(path, '^\w+\.py$', 0, sort=False) # Ver 2.2.1 models = listdir(path, '^\w+\.py$', 0) # Ver 2.3.2 If I restore that, it works again. The issue was discussed here: https://groups.google.com/d/topic/web2py/ZfI7K9jW45w/discussion In Ver 2.2.1, files in the models directory are first loaded in alphabetically order. Then each subfolder is handled in order, model files in subfolders are loaded in alphabetical order. In Ver 2.3.2, all models are sorted by path name and then loaded in that order. I can rename subfolders so they are loaded properly but before I change anything I'd like to make sure the effects of dropping sort=False were intended. --
[web2py] Re: Ver 2.3.2 changes the order models are loaded.
Sounds good. Thanks guys On Thursday, December 20, 2012 1:12:20 PM UTC-5, Jim Karsten wrote: I have database tables defined in models/db.py. I have a controller-specific model defined in a models/client subdirectory. Ver 2.3.2 loads the models in a different order from ver 2.2.1. Ver 2.2.1 models/0.py models/db.py models/clients/edit/db.py Ver 2.3.2 models/0.py models/clients/edit/db.py models/db.py The models/clients/edit/db.py depends on variables defined in modes/db.py so I get errors with Ver 2.3.2 The sort=False argument was removed from the listdir call in this line of gluon/compileapp.py def run_models_in() models = listdir(path, '^\w+\.py$', 0, sort=False) # Ver 2.2.1 models = listdir(path, '^\w+\.py$', 0) # Ver 2.3.2 If I restore that, it works again. The issue was discussed here: https://groups.google.com/d/topic/web2py/ZfI7K9jW45w/discussion In Ver 2.2.1, files in the models directory are first loaded in alphabetically order. Then each subfolder is handled in order, model files in subfolders are loaded in alphabetical order. In Ver 2.3.2, all models are sorted by path name and then loaded in that order. I can rename subfolders so they are loaded properly but before I change anything I'd like to make sure the effects of dropping sort=False were intended. --