What I’m trying to do:
Get a list of all anvil.server.call()able functions, in order to populate a client-side dropdown
What I’ve tried and what’s not working:
Searched Anvil docs
What I’m trying to do:
Get a list of all anvil.server.call()able functions, in order to populate a client-side dropdown
What I’ve tried and what’s not working:
Searched Anvil docs
I suspect the list you get in the IDE is only available in the IDE. You could create a Python decorator to put on each function (in addition to the one that makes it callable) that would populate a list in the server, and then create a server call to retrieve that list.
This feature request asks for something similar: a dashboard that shows all the functions for the account. It’s a feature request because we don’t have it (yet?).
If I understand you are looking for something similar, but you want to get the list from code, not on a console. Perhaps your request would be even better, because if I could get that list described in my FR from code, then I could make my own dashboard.
In the server module:
def registered_functions() -> list:
from anvil._server import registrations # dont use _functions it's bad mkay
# print(registrations)
return list(registrations.keys())
ymmv, yadda yadda yadda see here:
This list might not be comprehensive, it might only be what the sever module has registered that does not include uplinks, I am not sure. You would have to test.
Incredible, thank you @jshaffstall and @stefano.menci for the helpful comments, and @ianb for this wonderfully idiomatic solution!