Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

magic-removal: Fixed __collect_sub_objects, so delete() now works and…

… some more tests pass.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2248 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3c1bdb0d90c82a9c0abf77b20573d63a592b08ad 1 parent 2ff5e5e
@spookylukey spookylukey authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/db/models/base.py
View
6 django/db/models/base.py
@@ -202,16 +202,16 @@ def __collect_sub_objects(self, seen_objs):
seen_objs.setdefault(self.__class__, {})[pk_val] = self
for related in self._meta.get_all_related_objects():
- rel_opts_name = related.OLD_get_accessor_name()
+ rel_opts_name = related.get_accessor_name()
if isinstance(related.field.rel, OneToOne):
try:
- sub_obj = getattr(self, 'get_%s' % rel_opts_name)()
+ sub_obj = getattr(self, rel_opts_name)
except ObjectDoesNotExist:
pass
else:
sub_obj.__collect_sub_objects(seen_objs)
else:
- for sub_obj in getattr(self, 'get_%s_list' % rel_opts_name)():
+ for sub_obj in getattr(self, rel_opts_name).all():
sub_obj.__collect_sub_objects(seen_objs)
def delete(self):
Please sign in to comment.
Something went wrong with that request. Please try again.