What I’m trying to do:
I am creating a simple app to add users to my main app.
What I’ve tried and what’s not working:
I have added the main app as a dependency on the UserManager app. I tried to call the main app’s “add_user” server function but I get:
anvil.server.NoServerFunctionError: No server function matching “add_user_test” has been registered
Code Sample:
On the UserManager app:
def create_user_button_click(self, **event_args):
anvil.server.call('add_user', self.email_text_box.text)
On the main app:
@anvil.server.callable
def add_user(email):
row = app_tables.users.add_row(
email=email,
enabled=True)
I was unsure whether the UseManager app was getting the most upt-to-date code, so I made some changes to a utils function I alredy had coded and called it from the UsersManager app, the code wasn’t getting updated.
Is this a viable way to tackle writing to other app’s databases? How can I get updated code from the dependency import?