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