Hi Yarko,

first there is no typo in Massimo's function.

The problem, as you noted later, is the comparison, it should be: v is
obj, not v==obj, so the function could be:
def getNames(obj): return ([k for k,v in globals().items() if v is obj]
+[None])[0]
(the [None] is needed so there will not be an IndexError if the list
is empty).

About how I am going to use this... it is a secret.
Not!
I am creating handlers (controller functions) for autocompletes if
they don't already exist.
It is part of a patch I am working on, to be submitted for
consideration later.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to