summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-03-06 11:50:04 -0800
committerAndrew Godwin <andrew@aeracode.org>2014-03-06 11:50:04 -0800
commit8ce3ea687cfae0bc47fcf023cb1f523dae4664ef (patch)
tree91fe0cb26c1d514e42fdcdbe5eb91ff7fdb40387
parent1562b9896f8f614ef40fd032b1ec777280b377c1 (diff)
Revert "Fixed #22183: Don't make a table for M2Ms with through="
This reverts commit 1562b9896f8f614ef40fd032b1ec777280b377c1.
-rw-r--r--django/db/backends/schema.py3
-rw-r--r--django/db/models/fields/related.py2
2 files changed, 1 insertions, 4 deletions
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index 7054633b81..afc60c30b1 100644
--- a/django/db/backends/schema.py
+++ b/django/db/backends/schema.py
@@ -262,8 +262,7 @@ class BaseDatabaseSchemaEditor(object):
})
# Make M2M tables
for field in model._meta.local_many_to_many:
- if field.rel.through._meta.auto_created:
- self.create_model(field.rel.through)
+ self.create_model(field.rel.through)
def delete_model(self, model):
"""
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 16de0bfc74..e7b66217c5 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -2032,8 +2032,6 @@ class ManyToManyField(RelatedField):
kwargs['to'] = self.rel.to
else:
kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name)
- if getattr(self.rel, 'through', None) is not None:
- kwargs['through'] = self.rel.through
# If swappable is True, then see if we're actually pointing to the target
# of a swap.
swappable_setting = self.swappable_setting