[NOTABUG] Calling add_row function on table with space in name

Calling this function

@anvil.server.callable
def publish_hello_event():
  try:
    print('I am in the publish_hello_event call in the server')
    app_tables.event_store.add_row(Events='Hello')
  except Exception as e: 
    print(e)

Does not work. It does not add anything to the table called “Event Store”. Notice the space. The table name as named in DataTables is 'Event Store". There are no errors thrown by anvil. Nothing printed.

However if I refactor the function to

@anvil.server.callable
def publish_hello_event():
  try:
    print('I am in the publish_hello_event call in the server')
    app_tables.eventstore.add_row(Events='Hello')
  except Exception as e: 
    print(e)

and the DataTables name to “EventStore”. Everything is fine.

EDIT:
Now the “working” version is intermittently either very slow, or not working at all, meaning that there are no errors being logged, and I can’t add any information to DataTables. It could be an Anvil backend issue, or a display issue, where I have to close the DataTables tab, and then refresh.

This could just be the default functionality, where you have to close the datatable tab, and I’m just now noticing it, but it’s not the main issue.

Clone link:
share a copy of your app

Thanks for letting us know about this, @nathanguyette. I have now moved this thread to Bug Reports.

Hi @nathanguyette,

I’m having trouble reproducing this. Could you please elaborate on what you mean by “Doesn’t work” here? How long does the spinner take? Is there anything in App Logs, as well as the absence of printing?

@meredydd, @patricia,

Hey thanks for looking into this.

I think this was a goober mistake on my side where I didn’t hit the “refresh” button" on the DataTables after inserting a new row.

:blush:

3 Likes