Modules have to be imported -- only classes/objects defined in model files 
are available in all controllers (and views). Note, by default, the web2py 
globals (i.e., request, response, session, validators, HTML helpers) will 
not be available in your modules, so you either have to pass them in as 
arguments to classes/functions, or use the new thread local 'current' 
object. For some examples of the latter, 
see 
http://martin.tecnodoc.com.ar/default/post/2011/09/12/7_optimize-your-web2py-app-using-the-new-import-method.

Anthony

On Sunday, September 25, 2011 3:28:45 PM UTC-4, monotasker wrote:
>
> Where should I put files with custom python classes to take care of 
> business logic (and get it out of my controllers)? Do I have to set these up 
> as a module and import them into th controller or will the classes 
> automatically be available to any controller?
>
> Thanks,
>
> Ian
>
>

Reply via email to