Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #452 -- Fixed bug in generated DB API for models that have two …

…ManyToManyFields to the same related model.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a58dc0dbbdb4d482d26650f4a72ffb08ef1184cf 1 parent fa9cbe5
Adrian Holovaty authored

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

  1. 10  django/core/meta/__init__.py
10  django/core/meta/__init__.py
@@ -532,13 +532,9 @@ def get_all_related_many_to_many_objects(self):
532 532
         rel_objs = []
533 533
         for mod in module_list:
534 534
             for klass in mod._MODELS:
535  
-                try:
536  
-                    for f in klass._meta.many_to_many:
537  
-                        if f.rel and self == f.rel.to:
538  
-                            rel_objs.append(RelatedObject(self, klass._meta, f))
539  
-                            raise StopIteration
540  
-                except StopIteration:
541  
-                    continue
  535
+                for f in klass._meta.many_to_many:
  536
+                    if f.rel and self == f.rel.to:
  537
+                        rel_objs.append(RelatedObject(self, klass._meta, f))
542 538
         return rel_objs
543 539
 
544 540
     def get_ordered_objects(self):

0 notes on commit a58dc0d

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