Changes between Version 1 and Version 2 of Ticket #35376, comment 2
- Timestamp:
- Apr 15, 2024, 1:13:04 PM (7 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35376, comment 2
v1 v2 1 I think there might more to it here given `Building.restaurant` is a reverse one-to-one and thus there is no field stored on `Building` to reference it and thus no field to ''defer''.1 I think there might more to it here given `Building.restaurant` is a reverse one-to-one and thus there is no field stored on `Building` to reference it and thus no field to include in the select mask (include in `only` and excluded from `exclude`) for `prefetch_related` to work properly. 2 2 3 If `.city` was used in the test then it would have been a duplicate of #33835 (and [https://github.com/django/django/blob/47c608202a58c8120d049c98d5d27c4609551d33/tests/defer/tests.py#L315-L329 something we could warn about] like we do with `select_related` + `only` misuse) as using `prefetch_related("city")` requires that `"city_id"` is included in the select mask (include in `only` and excluded from `exclude`) but here it looks like somethingdifferent.3 If `.city` was used in the test (instead of `.restaurant`) then it would have been a duplicate of #33835 (and [https://github.com/django/django/blob/47c608202a58c8120d049c98d5d27c4609551d33/tests/defer/tests.py#L315-L329 something we could warn about] like we do with `select_related` + `only` misuse) as using `prefetch_related("city")` requires that `"city_id"` is included in the select mask but here it looks like something slightly different.