I would expect to be able to restore a purged item:
from spinedb_api import DatabaseMapping
with DatabaseMapping("sqlite://", create=True) as db_map:
item, error = db_map.add_entity_class_item(name="my_class")
assert not error
db_map.purge_items("entity_class")
item.restore()
assert item.is_valid()
The above script, however, fails with assertion error from the last line, i.e. the item is, in fact, not valid.
I would expect to be able to restore a purged item:
The above script, however, fails with assertion error from the last line, i.e. the item is, in fact, not valid.