def check_deleted_nodes(self):
imported_nodes = Node.objects.filter(data__contains=['<STR_LIT>'])<EOL>deleted_nodes = []<EOL>for node in imported_nodes:<EOL><INDENT>if OldNode.objects.filter(pk=node.pk).count() == <NUM_LIT:0>:<EOL><INDENT>user = node.user<EOL>deleted_nodes.append(node)<EOL>node.delete()<EOL>if user.node_set.count() == <NUM_LIT:0>:<EOL><INDENT>user.delete()<EOL><DEDENT><DEDENT><DEDENT>if len(deleted_nodes) > <NUM_LIT:0>:<EOL><INDENT>self.message('<STR_LIT>' % len(deleted_nodes))<EOL><DEDENT>self.deleted_nodes = deleted_nodes<EOL>
delete imported nodes that are not present in the old database