Changes between Version 2 and Version 3 of Ticket #35376, comment 3


Ignore:
Timestamp:
Apr 15, 2024, 1:26:21 PM (7 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35376, comment 3

    v2 v3  
    1 Ah I think this is actually a duplicate of #35044 which is only resolved in `main`.
     1Ah I think this is actually a duplicate of #35044 [https://github.com/django/django/commit/73df8b54a2fab53bec4c7573cda5ad8c869c2fd8 which is only resolved] in `main`.
    22
    33What is happening here is that in the third case `restaurant` is prefetched and stored on the instance but then accessing `city_id` to prefetch the right `city` requires calling `refresh_from_db` (as it's excluded from the select mask) then #35044 (which clears all prefetched data on each `refresh_from_db` call) is triggered and the prefetched `restaurant` instance is discarded causing the access to the property in the test to refetch from the database.
Back to Top