On Wednesday, March 9, 2016 at 11:32:46 PM UTC-5, Ron Chatterjee wrote:
>
> Later, I see. So, if I have to call a function within a function I need to 
> define the other one in the model.
>

No, that's not the case. You said you need to use the function in multiple 
controllers, so you cannot therefore define it in just a single controller, 
or otherwise no other controllers will be able to access it. Instead, you 
can define it in a model file or in a module (and import it where needed).

You certainly can define a function within a controller and have other 
functions in that controller call it. However, note that any function in a 
controller can also be reached via URL unless its name begins with a double 
underscore or it takes at least one argument).

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/d/optout.

Reply via email to