Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed some now dead code from deletion (thanks to Carl Meyer for no…

…ticing it).
  • Loading branch information...
commit a170c3f755351beb35f8166ec3c7e9d524d9602d 1 parent bcdb489
Alex Gaynor authored
Showing with 0 additions and 14 deletions.
  1. +0 −14 django/db/models/deletion.py
View
14 django/db/models/deletion.py
@@ -75,7 +75,6 @@ def __init__(self, using):
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 @@ def add(self, objs, source=None, nullable=False, reverse_dependency=False):
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 @@ def delete(self):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.