Ok, then the right approach is the admin's (I think it reads the
controller files and does some sort of filtering with regular
expressions). It even collects all function names from any controller
in the app in a dictionary. What if web2py exposed that list for each
app in an environment object (although I cannot think of a benefit of
that service)?

On 19 mar, 15:14, Anthony <abasta...@gmail.com> wrote:
> I don't think that will distinguish functions defined in models or imported
> within models or the controller, though I guess in most cases such
> functions wouldn't have no arguments.
>
> Anthony
>
>
>
>
>
>
>
> On Monday, March 19, 2012 1:28:10 PM UTC-4, Alan Etkin wrote:
>
> > Would this work inside a controller?
>
> > # this module belongs to the Python Standard Library
> > #http://docs.python.org/library/inspect.html#module-inspect
>
> > import inspect
> > # when using the same globals() an exception is thrown
> > for k, v in globals().copy().iteritems():
> >     if inspect.isfunction(v):
> >         argspec = inspect.getargspec(v)
>
> >         # anything else to check?
> >         if len(argspec.args) == 0 and argspec.varargs is None and
> > argspec.keywords is None:
> >             # then this is a function of the current controller
> >             pass
>
> > On 19 mar, 11:13, Anthony <abasta...@gmail.com> wrote:
> > > Here's how the admin app does
> > > it:
> >http://code.google.com/p/web2py/source/browse/applications/admin/cont....
> > > You might try something like that.
>
> > > Anthony
>
> > > On Monday, March 19, 2012 6:16:45 AM UTC-4, Hassan Alnatour wrote:
>
> > > > Dear ALL ,
>
> > > > How Can I Get ALL controller functions , as i know i can get the one
> > > > am at in the view using request.function , so how can i get all of
> > > > them ??

Reply via email to