Exception: Cannot use the "tables" module in the designer

Any chance this exception can be resolved? I understand we don’t want server calls being made in the designer, but if you want to use a class to perform a condition check, this is very obnoxious.

For example, in one of my classes, I want to do an isinstance check to confirm that the data coming in is a Row instance. However, this little exception lights my custom form up in red.

Exception: Cannot use the "tables" module in the designer

It’s not documented, but see here:

for a way to avoid executing that code in the designer.

1 Like

For some reason, I thought that this little import had been removed, but to my delight it is still available.

from anvil.designer import in_designer

This solves the problem!

1 Like