diff options
| author | Carl Meyer <carl@oddbird.net> | 2012-04-09 22:41:20 +0000 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2012-04-09 22:41:20 +0000 |
| commit | f195f1ed2481d34ff56df36cf46ad7d377f2af93 (patch) | |
| tree | 6e9257f12599d3d76813c564c0e1275bebe85cad /django | |
| parent | 6f7aa51b2c3fbcbbc76404cee3cbe511feabaf1f (diff) | |
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
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/deletion.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py index 730847ef21..d8bb8f2e66 100644 --- a/django/db/models/deletion.py +++ b/django/db/models/deletion.py @@ -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, |
