Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# noinspection PyPackageRequirements
class TestExistsQuery: # region Tests
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) .filter(__ex=True) SELECT "app_itema"."id", "app_itema"."name", "app_itema"."parent_id", EXISTS( SELECT U0."id", U0."name", U0."item_c_id", True AS "__ex" FROM "app_container" U0 WHERE (U0."id" IN (1, 2, 3, 4, 5) AND U0."id" = ("app_itema"."parent_id"))) AS "__ex" FROM "app_itema" WHERE EXISTS( SELECT U0."id", U0."name", U0."item_c_id", True AS "__ex" FROM "app_container" U0 WHERE (U0."id" IN (1, 2, 3, 4, 5) AND U0."id" = ("app_itema"."parent_id")) ) = True """.strip()
Currently OuterRef fails silently on union, just marking that fact to be notified when this is fixed in django """, strict=True) def test_outer_ref_on_union(self): .annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) .annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) .filter(__ex=True)
Currently OuterRef fails silently on union, just marking that fact to be notified when this is fixed in django """, strict=True) def test_outer_ref_on_union_parts(self):
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) \ .filter(pk=OuterRef('parent'))
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) \ .filter(pk=OuterRef('parent'))
.filter(__ex=True)
assert re.search(r'.*."id" = (.*."parent_id")', str(outer_query.query))
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) \ .filter(pk=OuterRef('parent'))
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) \ .filter(pk=OuterRef('parent'))
.filter(__ex=True)
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField()))
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField()))
.filter(__ex=True)
Currently OuterRef fails silently on intersection, just marking that fact to be notified when this is fixed in django """, strict=True) def test_outer_ref_on_intersection(self): .annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) .annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) .filter(__ex=True)
Currently OuterRef fails silently on intersection, just marking that fact to be notified when this is fixed in django """, strict=True) def test_outer_ref_on_intersection_parts(self):
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) \ .filter(pk=OuterRef('parent'))
.annotate(__ex=ExpressionWrapper(Value(True), output_field=BooleanField())) \ .filter(pk=OuterRef('parent'))
.filter(__ex=True)
assert re.search(r'.*."id" = (.*."parent_id")', str(outer_query.query))
|