From a170c3f755351beb35f8166ec3c7e9d524d9602d Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 11 Jan 2013 20:59:29 -0800 Subject: [PATCH] Removed some now dead code from deletion (thanks to Carl Meyer for noticing it). --- django/db/models/deletion.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py index 6dff4a2882..1c3a582fc5 100644 --- a/django/db/models/deletion.py +++ b/django/db/models/deletion.py @@ -75,7 +75,6 @@ class Collector(object): self.using = using # Initially, {model: set([instances])}, later values become lists. self.data = {} - self.batches = {} # {model: {field: set([instances])}} self.field_updates = {} # {model: {(field, value): set([instances])}} # fast_deletes is a list of queryset-likes that can be deleted without # fetching the objects into memory. @@ -115,13 +114,6 @@ class Collector(object): source._meta.concrete_model, set()).add(model._meta.concrete_model) return new_objs - def add_batch(self, model, field, objs): - """ - Schedules a batch delete. Every instance of 'model' that is related to - an instance of 'obj' through 'field' will be deleted. - """ - self.batches.setdefault(model, {}).setdefault(field, set()).update(objs) - def add_field_update(self, field, value, objs): """ Schedules a field update. 'objs' must be a homogenous iterable @@ -303,12 +295,6 @@ class Collector(object): for instances in six.itervalues(self.data): instances.reverse() - # delete batches - for model, batches in six.iteritems(self.batches): - query = sql.DeleteQuery(model) - for field, instances in six.iteritems(batches): - query.delete_batch([obj.pk for obj in instances], self.using, field) - # delete instances for model, instances in six.iteritems(self.data): query = sql.DeleteQuery(model)