We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02aaa94 commit 817b7bcCopy full SHA for 817b7bc
polymorphic/tests/test_orm.py
@@ -1097,6 +1097,14 @@ def test_polymorphic__filtered_relation(self):
1097
).aggregate(count=Count("info_joined"))
1098
self.assertEqual(result, {"count": 2})
1099
1100
+ # We should get a BlogA and a BlogB
1101
+ result = BlogBase.objects.annotate(
1102
+ info_joined=FilteredRelation("bloga", condition=Q(BlogA___info__contains="joined")),
1103
+ ).filter(info_joined__isnull=True)
1104
+ self.assertEqual(result.count(), 2)
1105
+ self.assertIsInstance(result.first(), BlogA)
1106
+ self.assertIsInstance(result.last(), BlogB)
1107
+
1108
def test_polymorphic__expressions(self):
1109
1110
from django.db.models.functions import Concat
0 commit comments