#NEWLINE# def undelete( self , user = None ) : #NEWLINE# #INDENT# '\n        Undelete all collected instances that were deleted.\n\n        ' #NEWLINE# deletion_times = set ( [ o . deleted_on for o in instances . root_objs ] ) #NEWLINE# for ( model , instances ) in self . data . iteritems ( ) : #NEWLINE# #INDENT# pk_list = [ obj . pk for obj in instances ] #NEWLINE# model . _base_manager . filter ( pk__in = pk_list , deleted_on__in = deletion_times ) . update ( deleted_by = None , deleted_on = None )