Table Error in To-Do app tutorial

Hello Anvil forum,

Just starting today with Anvil. I like this, so I will invest a good number of hours going over the basic functionality.

I have my first simple question:

I did the tutorial from the site in which they create a “reminders list”. You can add reminders, and you can delete them. The tutorial finishes right there. It looks great! Now, oops. If I leave the code as it is, then as soon as I delete a row, then I cant add a new record without getting a table error, right at the moment when I try to reinitialize my repeating panel:

l = list(self.repeating_panel_todos.items) + [new_row]
self.repeating_panel_todos.items = lc
# (This instruction causes the table error, as if the repeating_panel contains deleted items ... I thought they were gone.)

The only way I can avoid the error is by reading the whole table again, every time I add a new record:

self.repeating_panel_todos.items = app_tables.todos.search()

What did I miss from the tutorial?

This really nice guys! Great work!

Hi @jrdev

Glad you’re enjoying Anvil (I think that is a common sentiment around here).

I think you are referring to the To-Do app.

I’ve played around with concatenating new items to the list of rows from the DataTable, and setting them as items in the repeating panel. I can eventually get the following error:

"anvil.tables.TableError: This row has been deleted
 while setting self.check_box_1.text = self.item['description']
 in a data binding for self.check_box_1"

Is this the error your’re getting?

I’ll be honest, I don’t have a great explanation for why this happens, but the Anvil folks (or others) will be able to help.

If you can share a clone link to the app, that may also help (although the error may be enough for the Anvil folks to know what is happening).

Yes, sorry about this! We will be re-recording that tutorial to remove the confusing part :slight_smile:

2 Likes

Thank You Guys! I figured out that something was out of sync between the video and the actual text instructions. I know, :wink: : , redoing videos is a pain! But, the video is excellent! So maybe just add some overlay text to the video with a note. That will be enough.

The idea of changing the repeating panel on the fly (by making it into a list and appending to it is not bad, actually can be great for many things). But I followed the notes, and I reload the complete dataset (more than enough for the time being). Anyway, so far so good! of course I have lots of questions because I reference back to my programming experience, but I will iron them out as I go!. I still have lots of reading to do, most of the things I will experience are standard apps programming issues, so I will keep reading to get a better grasp!

But so far! I feel like programming! :smile: And that in itself is a good sign!

Hi @meredydd, just as an text overlay to the video, no need to redo it. The video is quite good! Take same video and just add a little note as an overlay! People will paused and take a look at it!

Looking forward to get acquainted with Anvil and fast as possible! :smile:

Hi @jrdev ! The guys here are fantastic, knowledgeable and very helpful :laughing: let us know what you’re up to. Catch ya later!

6 posts were split to a new topic: Two components inside a DataGrid cell