diff options
| author | oliver <myungsekyo@gmail.com> | 2018-10-16 00:01:57 +0900 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-10-15 11:01:57 -0400 |
| commit | 1299421cadc4fcf63585f2f88337078e43e660e0 (patch) | |
| tree | 967626dd556d13de83fc6352ea0fb9eb003da8a3 /tests/many_to_many/models.py | |
| parent | f2e2a1bd4be8ec7624b081488292b804777a526a (diff) | |
Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on a many-to-many relation.
Diffstat (limited to 'tests/many_to_many/models.py')
| -rw-r--r-- | tests/many_to_many/models.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/many_to_many/models.py b/tests/many_to_many/models.py index 22911654ab..7047a4e5d0 100644 --- a/tests/many_to_many/models.py +++ b/tests/many_to_many/models.py @@ -55,3 +55,13 @@ class InheritedArticleA(AbstractArticle): class InheritedArticleB(AbstractArticle): pass + + +class NullableTargetArticle(models.Model): + headline = models.CharField(max_length=100) + publications = models.ManyToManyField(Publication, through='NullablePublicationThrough') + + +class NullablePublicationThrough(models.Model): + article = models.ForeignKey(NullableTargetArticle, models.CASCADE) + publication = models.ForeignKey(Publication, models.CASCADE, null=True) |
