i'd like your logic bruno, could you explain about the function, please? 000_essentials.py = what for? 100_authdatabase.py = what for? 200_dbmodel.py = what for? 300_validators.py = what for? 400_utilities.py = what for? 500_preload.py = what for?
thank you so much On Sun, May 1, 2011 at 11:03 AM, Bruno Rocha <rochacbr...@gmail.com> wrote: > My point of views is that in a simple and smaller app this approach is a > good (may be the only) option. > > I am now running with a different numerical order, using 3 digits > > 000_essentials.py > 100_authdatabase.py > 200_dbmodel.py > 300_validators.py > 400_utilities.py > 500_preload.py > > why? because between every model I have 99 empty spaces if I need to > include some new model without the need to rename all the others. > > But this is a mess if working with a large app, so I tried to create > classes and methods as: > > class mymodel(object): > def define_essentials(): > db = DAL('.....') > > def define_auth(): > auth = Auth(db...) > > def define_model(): > db.define_table('mytable',Field(....)) > > > So I can call mymodel.define_essentials() directly from the controller or > another main model, why? > > Imagine a large app with many models and many objects loaded in memory even > if you do not need them. > > But, I think web2py has a good MVC pattern used for controllers and views, > we are talking about how to have the same approach for model files. > > > -- > Bruno Rocha > [ About me: http://zerp.ly/rochacbruno ] > > > > On Sun, May 1, 2011 at 12:37 AM, pbreit <pbreitenb...@gmail.com> wrote: > >> I think either way is fine. In a bigger app, you might separate them out. >> >> Vinicius, I like that approach. >> > >