Tks for the helpful replies.

On Oct 25, 1:21 am, JimK <jkel...@gmail.com> wrote:
> You can leave the function in the controller file but pre-pend __ to
> the name.  This is the Python way to create private functions and it
> appears to be supported well in Web2Py.
>
> An example would be:
>
> def __privateFunc():
>
> On Oct 24, 5:18 am, Luther Goh Lu Feng <elf...@yahoo.com> wrote:
>
>
>
>
>
>
>
> > If I have a function that I intend to call from different controllers, but I
> > have no need for the function to have a view, where should this function be
> > defined? eg. a function that simply calculates the outcome of a math 
> > formula,
> > and several controllers will call this function to display the result.
>
> > Should it be defined within a controller, or elsewhere?

Reply via email to