What I’m trying to do:
I have code that I have written in deepnote (web-based jupyter notebook) that has multiple nested functions. I would like to paste this into anvil for a multi-user app. If I place all the code in the server, then I would have to change every function call to ‘anvil.server.call(<function_name>)’ .
I would like to be able to update the app with new code from the jupyter notebook. There are a ton of functions that will be updated over time so this would be time consuming if I would have to change the function call to the anvil format every time I updated.
Is there a way to accomplish this without having to change all the function names? Should I just put all the code in the form?
Code Sample:
# this is a formatted code snippet.
# paste your code between ```
#this is an example of a function that calls another function (between the **), I would like to not have to change all the **get_best_contact** formats.
def get_contact_sf(accountID):
for contact in contacts['records']:
contacts_list.append({'Id':contact['Id'],'Title':contact['Title']})
contact_found, key_contact_id, contact_rank = **get_best_contact**(contacts_list)
return contact_found, key_contact_id, contact_rank
Clone link:
share a copy of your app