Countless errors

Hello,
I’m trying to update specific rows in a data table and open forms without having to paste the navbar on every form I want to display and ended up having errors thrown on the basic anvil functions
I have tried changing the names but still seems to be getting the same errors

Code Sample:

#update table row code 
#client
target = app_tables.info.get(Id=anvil.users.get_user(allow_remembered=True)['email'])
anvil.server.call('add_name',targetrow=target content=self.change_username.text)

#server
def add_name(targetrow,content):
  target.update(username=content)

#error
AnvilWrappedError: update

#form import code
from ..homes import homes
new_panel = homes()
get_open_form().content_panel.clear()
get_open_form().content_panel.add_component(new_panel)

#error
AttributeError: module '(app name).homes' has no attribute 'homes'

Is this a common problem of is my app so intricate that I have broke Anvil?

Pardon the lack of the clone link I’m hoping to drop a surprise project in #show-and-tell once I get finished

It’s hard to diagnose without the full context of a clone. You’re showing the client calling a server function called add_name, but the server function you show us is update_username. If that were the actual error, you’d be getting something along the lines of unknown server function.

You don’t need to pass server function arguments as keyword arguments (I don’t know if that affects anything or not, as I’ve never typed out the extra bits to pass them as keyword arguments).

The import issue seems pretty clear, the homes package doesn’t have a homes attribute. If you allowed the autocompleter to form the import, it should just work. But without a clone it’s impossible to say why it isn’t working.

2 Likes

Thanks, I did minify the server calls and instead of using the method of replacing just the main content instead I just did open_form, and it seems to be working fine now