Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…ticing it).
  • Loading branch information...
commit a170c3f755351beb35f8166ec3c7e9d524d9602d 1 parent bcdb489
authored January 11, 2013

Showing 1 changed file with 0 additions and 14 deletions. Show diff stats Hide diff stats

  1. 14  django/db/models/deletion.py
14  django/db/models/deletion.py
@@ -75,7 +75,6 @@ def __init__(self, using):
75 75
         self.using = using
76 76
         # Initially, {model: set([instances])}, later values become lists.
77 77
         self.data = {}
78  
-        self.batches = {} # {model: {field: set([instances])}}
79 78
         self.field_updates = {} # {model: {(field, value): set([instances])}}
80 79
         # fast_deletes is a list of queryset-likes that can be deleted without
81 80
         # fetching the objects into memory.
@@ -115,13 +114,6 @@ def add(self, objs, source=None, nullable=False, reverse_dependency=False):
115 114
                 source._meta.concrete_model, set()).add(model._meta.concrete_model)
116 115
         return new_objs
117 116
 
118  
-    def add_batch(self, model, field, objs):
119  
-        """
120  
-        Schedules a batch delete. Every instance of 'model' that is related to
121  
-        an instance of 'obj' through 'field' will be deleted.
122  
-        """
123  
-        self.batches.setdefault(model, {}).setdefault(field, set()).update(objs)
124  
-
125 117
     def add_field_update(self, field, value, objs):
126 118
         """
127 119
         Schedules a field update. 'objs' must be a homogenous iterable
@@ -303,12 +295,6 @@ def delete(self):
303 295
         for instances in six.itervalues(self.data):
304 296
             instances.reverse()
305 297
 
306  
-        # delete batches
307  
-        for model, batches in six.iteritems(self.batches):
308  
-            query = sql.DeleteQuery(model)
309  
-            for field, instances in six.iteritems(batches):
310  
-                query.delete_batch([obj.pk for obj in instances], self.using, field)
311  
-
312 298
         # delete instances
313 299
         for model, instances in six.iteritems(self.data):
314 300
             query = sql.DeleteQuery(model)

0 notes on commit a170c3f

Please sign in to comment.
Something went wrong with that request. Please try again.