mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #22476: Couldn't alter attributes on M2Ms with through= set
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user