Get_id() on draft row raises ValueError

I was hoping to use get_id() to check if a row is draft, as the docs say this will return None:

Anvil Docs | Buffering Changes

Until a draft has been saved, its get_id() method will return None as it has no unique identity.

I also noticed in model classes, attempting to delete a draft bypasses the _do_delete() method - and raises a SerializationError as expected. Probably because _do_delete is executed on the server?

I’ll settle for a try-except block but it would be nice if get_id() returned None on drafts.

1 Like

Thanks @yahiakalabs, we’ll take a look and see which behaviour should be correct here.