def content_removed(content, event): if (event.object != content or IObjectWillBeAddedEvent.providedBy(event) or event.newParent == event.oldParent): return if IOrderableContainer.providedBy(event.oldParent): manager = IOrderManager(event.oldParent) manager.remove(content)
def validate(self, container): return (IOrderableContainer.providedBy(container) and hasattr(container, '_ordered_ids'))