equal
deleted
inserted
replaced
611 else: |
611 else: |
612 entities = [entity] |
612 entities = [entity] |
613 etype = entities[0].__regid__ |
613 etype = entities[0].__regid__ |
614 for attr, storage in self._storages.get(etype, {}).items(): |
614 for attr, storage in self._storages.get(etype, {}).items(): |
615 for entity in entities: |
615 for entity in entities: |
616 try: |
616 if event == 'deleted': |
|
617 storage.entity_deleted(entity, attr) |
|
618 else: |
617 edited = entity.cw_edited |
619 edited = entity.cw_edited |
618 except AttributeError: |
|
619 assert event == 'deleted' |
|
620 getattr(storage, 'entity_deleted')(entity, attr) |
|
621 else: |
|
622 if attr in edited: |
620 if attr in edited: |
623 handler = getattr(storage, 'entity_%s' % event) |
621 handler = getattr(storage, 'entity_%s' % event) |
624 to_restore = handler(entity, attr) |
622 to_restore = handler(entity, attr) |
625 restore_values.append((entity, attr, to_restore)) |
623 restore_values.append((entity, attr, to_restore)) |
626 try: |
624 try: |