Ticket #13251: changes.patch
File changes.patch, 2.6 KB (added by , 15 years ago) |
---|
-
django/db/models/base.py
631 631 self._collect_sub_objects(seen_objs) 632 632 633 633 # Actually delete the objects. 634 delete_objects(seen_objs, using )634 delete_objects(seen_objs, using, self) 635 635 636 636 delete.alters_data = True 637 637 -
django/db/models/signals.py
8 8 pre_save = Signal(providing_args=["instance", "raw"]) 9 9 post_save = Signal(providing_args=["instance", "raw", "created"]) 10 10 11 pre_delete = Signal(providing_args=["instance" ])12 post_delete = Signal(providing_args=["instance" ])11 pre_delete = Signal(providing_args=["instance", "origin"]) 12 post_delete = Signal(providing_args=["instance", "origin"]) 13 13 14 14 post_syncdb = Signal(providing_args=["class", "app", "created_models", "verbosity", "interactive"]) 15 15 -
django/db/models/query.py
437 437 438 438 if not seen_objs: 439 439 break 440 delete_objects(seen_objs, del_query.db )440 delete_objects(seen_objs, del_query.db, self) 441 441 442 442 # Clear the result cache, in case this QuerySet gets reused. 443 443 self._result_cache = None … … 1266 1266 pass 1267 1267 return obj, index_end 1268 1268 1269 def delete_objects(seen_objs, using ):1269 def delete_objects(seen_objs, using, origin): 1270 1270 """ 1271 1271 Iterate through a list of seen classes, and remove any instances that are 1272 1272 referred to. … … 1296 1296 # Pre-notify all instances to be deleted. 1297 1297 for pk_val, instance in items: 1298 1298 if not cls._meta.auto_created: 1299 signals.pre_delete.send(sender=cls, instance=instance )1299 signals.pre_delete.send(sender=cls, instance=instance, origin=origin) 1300 1300 1301 1301 pk_list = [pk for pk,instance in items] 1302 1302 … … 1328 1328 setattr(instance, field.attname, None) 1329 1329 1330 1330 if not cls._meta.auto_created: 1331 signals.post_delete.send(sender=cls, instance=instance )1331 signals.post_delete.send(sender=cls, instance=instance, origin=origin) 1332 1332 setattr(instance, cls._meta.pk.attname, None) 1333 1333 1334 1334 if forced_managed: