I was going to call the pagination from multiple controller. I have about 10 of them use pagination and tired of keep typing up the same over and over again and clutter the page. Okay...so, these what I understood so far:
(1) I can make a call to pagination from multiple controller inside default.py if I have pagination function defined in model. (2) I can make a call to pagination from multiple controller inside default.py if I have pagination function defined in module but in that case I have to import it. from xxxx import xxxx (3) I can make a call to pagination from multiple controller inside default.py if I have pagination function defined in controller (default.py) but in that case I have to use URL redirect. And in URL redirect I can pass arguments. Have I got 1, 2 and 3 right? Questions. If I use URL redirect, I can pass an input argument (I call input parameter) to pagination function, but how I get the output (or the return values). An example will be great. I thought LOAD is same like URL redirect. So, in that case I can also use LOAD as well. Right? Thank you in advance. On Thursday, March 10, 2016 at 8:19:27 AM UTC-5, Anthony wrote: > > 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.

