Web2py execute the models in alphabetical order, some people put number before the name of the model ex: 0config.py , I put underscore ex: _config.py. There are no other reason, is not a python thing . Web2py have many changes since instant press was written some things can be rewrite in different way or improved.
2011/7/22 DanB <[email protected]> > > I've working with web2py for a little while now (loving it!), and been > poking through a few appliances, especially Instant Press!) to puzzle > out how things work. This is probably a basic Python question, or > maybe it's something about web2py, so here goes. > > I noticed that in instant Press, the application uses a top-level > class (superclass?) to load it's modules and their associated models > (the _i2p.py file in the models folder), and this class is > instantiated in db.py. I was trying to follow this pattern, and > noticed that if I don't prefix the file name with an underscore (e.g. > myclass.py), it isn't available, but as soon as I add that underscore > to the filename (e.g. _myclass.py) it works. > > Why is this? All I could find in the Python documentation was mention > that functions that begin with an underscore are not loaded during " > from myclass import * ". > > Thanks in advance! -- http://martin.tecnodoc.com.ar

