On Jun 11, 4:52 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > What if we have folders like > > models/__init__.py > models/default/__init__.py > models/default/index.py > > and __init__ is executed for every action and controller > and default/__init__ is executed for every action in controller > default.py > and default/index only for the index action, etc etc.
Not sure I like the atomization into possibly many files. On the other hand something more compact as one file with functions ala controllers might become quite large. On Jun 11, 10:39 pm, AchipA <attila.cs...@gmail.com> wrote: > a) if there is no stuff.py in models, we include all models, > convenient for development, friendly to newbies If no stuff.py include everything else?. I am against this one. > Now, for the kicker - in the model we could do an equivalent of > {{extend 'layout.html'}} (=sort of import ?) to include any > dependencies. This would also pull in any 'common' models (just like > we do with layout.html). Note the subtle difference - I don't want a > single EXTRA model to be included - I want to avoid loading > unnecessary models. I must be tired, I fail to see the subtle difference. The model related to a controller (stuff) moves to a separate file (stuff.py). Nothing extra. If stuff is called and stuff.py model is there run it. If not then run common.py (or similar). Can it be self contained (no dependencies)?. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---