def cleanup_relations(instance, **kwargs):
if getattr(instance, '__handling_delete', False):
return
rels_seen, to_delete, to_put = get_cleanup_entities(instance)
_get_included_cleanup_entities((instance,), rels_seen, to_delete, to_put)
for entity in [instance] + to_delete:
entity.__handling_delete = True
if to_delete:
db.delete(to_delete)
for entity in [instance] + to_delete:
del entity.__handling_delete
if to_put:
db.put(to_put)
评论列表
文章目录