there is one convention in web2py that I am not happy with. The fact that models are executed alphabetically. Originally I thought each model would correspond to one database connection and so they would independent and thus the order of execution would not matter. I was wrong, most people write dependent model files. Thus the order of execution is important and it is good that we have one. Nevertheless alphabetical execution is probably not the best choice.
I have been thinking about creating a mapping file to determine the order of execution but it would increase too much the complexity of web2py Each model could declare its own dependencies and a mapping file could be generated automatically and hidden under the hood. conditional execution fits in this discussion. Perhaps model files could have names like if_controller_db.py so that it would be executed only if the it_[controller] matches the current controller. ideas? comments? Massimo On Jun 11, 3:08 pm, DenesL <denes1...@yahoo.ca> wrote: > Using the common code in the controller as a model substitute? > There goes the MVC separation. > And the other models still get executed. > > I think AchipA means execute one model only. > The problem is that models are executed before controllers (aren't > they?), but then this points back to using ifs in models as suggested > by Massimo. > > Let's suppose we change that. > Where do you keep common model code? > common = used by all ctls, except those with a name > In a reserved model whose name can not be used as a controller? > runs if no model named as request.controller > newbie (and everybody else) has to think harder how to split models. > > Not pro/against anything yet, just thinking aloud. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---