Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Luke Plant authored February 03, 2006

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

  1. 6  django/db/models/base.py
6  django/db/models/base.py
@@ -202,16 +202,16 @@ def __collect_sub_objects(self, seen_objs):
202 202
         seen_objs.setdefault(self.__class__, {})[pk_val] = self
203 203
 
204 204
         for related in self._meta.get_all_related_objects():
205  
-            rel_opts_name = related.OLD_get_accessor_name()
  205
+            rel_opts_name = related.get_accessor_name()
206 206
             if isinstance(related.field.rel, OneToOne):
207 207
                 try:
208  
-                    sub_obj = getattr(self, 'get_%s' % rel_opts_name)()
  208
+                    sub_obj = getattr(self, rel_opts_name)
209 209
                 except ObjectDoesNotExist:
210 210
                     pass
211 211
                 else:
212 212
                     sub_obj.__collect_sub_objects(seen_objs)
213 213
             else:
214  
-                for sub_obj in getattr(self, 'get_%s_list' % rel_opts_name)():
  214
+                for sub_obj in getattr(self, rel_opts_name).all():
215 215
                     sub_obj.__collect_sub_objects(seen_objs)
216 216
 
217 217
     def delete(self):

0 notes on commit 3c1bdb0

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