Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@adrianholovaty adrianholovaty authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 django/core/meta/__init__.py
View
10 django/core/meta/__init__.py
@@ -532,13 +532,9 @@ def get_all_related_many_to_many_objects(self):
rel_objs = []
for mod in module_list:
for klass in mod._MODELS:
- try:
- for f in klass._meta.many_to_many:
- if f.rel and self == f.rel.to:
- rel_objs.append(RelatedObject(self, klass._meta, f))
- raise StopIteration
- except StopIteration:
- continue
+ for f in klass._meta.many_to_many:
+ if f.rel and self == f.rel.to:
+ rel_objs.append(RelatedObject(self, klass._meta, f))
return rel_objs
def get_ordered_objects(self):
Please sign in to comment.
Something went wrong with that request. Please try again.