Get_id while debugging

I haven’t got my head around Testing/Debugging best practices in Anvil yet* and so find myself reverting to adding print() statements as checkpoints like I did for ages before discovering Test Driven Development…

Anyway, I found myself checking specific data table rows hundreds of times now, and although it’s no great hardship to write print(self.item.get_id()) hundreds of times, I did wonder if a better DRY solution (which would take very little time to action) might be to add the .get_id() result to the ‘human readable’ __str__ method of Anvil Row objects, and also add Row ID to the Data Tables display in the IDE?

* That’s a whole other topic for me to browse on the forums, unless I’ve missed a handy/definitive Tutorial somehwere?

4 Likes