dwithin lookup in a subquery using OuterRef as a parameter.
(self)
| 326 | @skipUnlessGISLookup("dwithin") |
| 327 | @skipUnlessDBFeature("has_Transform_function") |
| 328 | def test_dwithin_subquery(self): |
| 329 | """dwithin lookup in a subquery using OuterRef as a parameter.""" |
| 330 | qs = CensusZipcode.objects.annotate( |
| 331 | annotated_value=Exists( |
| 332 | SouthTexasCity.objects.filter( |
| 333 | point__dwithin=(OuterRef("poly"), D(m=10)), |
| 334 | ) |
| 335 | ) |
| 336 | ).filter(annotated_value=True) |
| 337 | self.assertEqual(self.get_names(qs), ["77002", "77025", "77401"]) |
| 338 | |
| 339 | @skipUnlessGISLookup("dwithin") |
| 340 | @skipUnlessDBFeature("supports_dwithin_distance_expr") |