On Jul 27, 2010, at 9:26 AM, Mathieu Clabaut wrote:

> But then note that you have to pass as arguments to your helpers objects that 
> are otherwise directly available in models and controllers, like : db, 
> request, response, T, auth,...

Or import them. I wrote a module to give me a nicer interface to DataTables. It 
starts out:

from gluon.html import TABLE, THEAD, TBODY, TFOOT, TR, TD, TH, XML


> -Mathieu
> 
> On Mon, Jul 26, 2010 at 21:03, Iceberg <iceb...@21cn.com> wrote:
> Put your helpers into modules, then use local_import(...). See also:
> http://web2py.com/book/default/search?search=local_import
> 
> (Sent from my thinkpad)
> 
> On Jul 27, 1:02am, rochacbruno <rochacbr...@gmail.com> wrote:
> > I dont think it is the right way, but I use to create a config.py and a 
> > helper.py in my models.
> >
> > The classes, methods, functions defined in model are available to 
> > cobtroller and views.
> >
> > But I think the best way is creating external modules.
> >
> > Sent from my iPhone
> >
> > On 26/07/2010, at 13:04, VP <vtp2...@gmail.com> wrote:
> >
> >
> >
> > > I have a bunch of functions that are not meant to be exposed (via URL)
> > > but rather to be helping out with things (and to be called by
> > > functions defined in controllers).  Where do I put these?  And how do
> > > I import them into controllers?
> >
> > > I tried to place them in private or modules, but it doesn't seem to
> > > work (I can't import them in controllers).
> >
> > > Thanks.
> 


Reply via email to