On Friday, January 17, 2014 7:18:00 PM UTC-5, 黄祥 wrote:
>
> is conditional models is same like response.models_to_run()? because i 
> searched in this form related with conditional models, 
>

Yes, "conditional models" generally refers to use of models_to_run. Note, 
there is a default models_to_run that runs models in folders named the same 
as the current controller and (optionally) function. You can change that by 
specifying a custom models_to_run.
 

> another thing is, how about the performance according to put the models 
> into modules and response.models_to_run()? which is better?
>

Assuming you use models_to_run to define the exact same set of models as 
you import from modules, then performance should be similar, with a slight 
edge to the import method (using models_to_run requires putting models in 
model files, which must be read in and executed on each request, whereas 
module files do not need to be read on every request, only on the first 
import).

If you need very fine-grained control over exactly which models are defined 
when, importing from modules exactly when/where needed might be simpler 
than trying to conditionally define models_to_run (which must be done 
within the model files, before you get to the controller code).

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to