[web2py] Re: [Web2py] Stop the processing of the models midway

2011-11-02 Thread Fran
> 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

Re: [web2py] Re: [Web2py] Stop the processing of the models midway

2011-11-02 Thread villas
How about something like wrapping all your normal models inside a condition block... if not request.controller in []:

Re: [web2py] Re: [Web2py] Stop the processing of the models midway

2011-11-02 Thread Bruno Rocha
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

Re: [web2py] Re: [Web2py] Stop the processing of the models midway

2011-11-02 Thread pbreit
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?

Re: [web2py] Re: [Web2py] Stop the processing of the models midway

2011-11-02 Thread anubhav aggarwal
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

[web2py] Re: [Web2py] Stop the processing of the models midway

2011-11-02 Thread villas
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.