1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #18083 -- Fixed cascade deletion with proxy model of concrete subclass. Thanks Simon Charette for report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer
2012-04-09 22:41:20 +00:00
parent 6f7aa51b2c
commit f195f1ed24
3 changed files with 42 additions and 12 deletions

View File

@@ -154,9 +154,10 @@ class Collector(object):
model = new_objs[0].__class__
# Recursively collect parent models, but not their related objects.
# These will be found by meta.get_all_related_objects()
for parent_model, ptr in model._meta.parents.iteritems():
# Recursively collect concrete model's parent models, but not their
# related objects. These will be found by meta.get_all_related_objects()
concrete_model = model._meta.concrete_model
for ptr in concrete_model._meta.parents.itervalues():
if ptr:
parent_objs = [getattr(obj, ptr.name) for obj in new_objs]
self.collect(parent_objs, source=model,