diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-05-08 10:33:59 -0700 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-05-08 10:34:45 -0700 |
| commit | f2bf59a5bc373eeb60136f3b3764e156efbc1ea8 (patch) | |
| tree | 0a27a7e91b2af5f9091d4b967deabec7e54e59da /tests/schema/models.py | |
| parent | bc82c0dbac33ced1a4d6953e8626236ae05af956 (diff) | |
[1.7.x] Fixed #22476: Couldn't alter attributes on M2Ms with through= set
Diffstat (limited to 'tests/schema/models.py')
| -rw-r--r-- | tests/schema/models.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/schema/models.py b/tests/schema/models.py index f85a3c6362..f5f59f7416 100644 --- a/tests/schema/models.py +++ b/tests/schema/models.py @@ -24,6 +24,22 @@ class AuthorWithM2M(models.Model): apps = new_apps +class AuthorWithM2MThrough(models.Model): + name = models.CharField(max_length=255) + tags = models.ManyToManyField("schema.TagM2MTest", related_name="authors", through="AuthorTag") + + class Meta: + apps = new_apps + + +class AuthorTag(models.Model): + author = models.ForeignKey("schema.AuthorWithM2MThrough") + tag = models.ForeignKey("schema.TagM2MTest") + + class Meta: + apps = new_apps + + class Book(models.Model): author = models.ForeignKey(Author) title = models.CharField(max_length=100, db_index=True) |
