mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #26304 -- Ignored unmanaged through model in table introspection.
This commit is contained in:
parent
5155c2b458
commit
60633ef3de
4 changed files with 19 additions and 2 deletions
|
@ -45,6 +45,7 @@ class Article(models.Model):
|
|||
body = models.TextField(default='')
|
||||
reporter = models.ForeignKey(Reporter, models.CASCADE)
|
||||
response_to = models.ForeignKey('self', models.SET_NULL, null=True)
|
||||
unmanaged_reporters = models.ManyToManyField(Reporter, through='ArticleReporter')
|
||||
|
||||
def __str__(self):
|
||||
return self.headline
|
||||
|
@ -54,3 +55,11 @@ class Article(models.Model):
|
|||
index_together = [
|
||||
["headline", "pub_date"],
|
||||
]
|
||||
|
||||
|
||||
class ArticleReporter(models.Model):
|
||||
article = models.ForeignKey(Article, models.CASCADE)
|
||||
reporter = models.ForeignKey(Reporter, models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue