> You may also wish to consider using sub-folders for models
We have our own Conditional Model Loading system to handle not having to
load all models all the time.
We can't simply use the Web2Py system as we have too many inter-linkages
across models/controllers.
> is there a specific reason yo
How about something like wrapping all your normal models inside a condition
block...
if not request.controller in []:
Not really a good solution, but you can do in the beggining of every model
file.
if request.function in ['index', 'another', 'other']:
#model code goes here
this way you can set which function will execute that model file.
On Wed, Nov 2, 2011 at 1:27 PM, anubhav aggarwal wrote:
> Thanks for
The only other thing I can think of is putting that code in a module.
http://web2py.com/book/default/chapter/04?search=module#Accessing-the-API-from-Python-modules
But is there a specific reason you want to suppress model execution? Are
you running into any sort of problem?
Thanks for the reply
You may also wish to consider using sub-folders for models.
>
> all files in
>
> models/a/
>
> are executed only for actions in controllers/a.py
>
>
> Actually we wanted to execute most of the models for all the controllers
except this particular controller which needs only 2
You may also wish to consider using sub-folders for models.
all files in
models/a/
are executed only for actions in controllers/a.py
all files in
models/a/b/
are executed only for actions b() in controllers/a.py
this is for every a and b.
6 matches
Mail list logo