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


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35376, comment 3

    v1 v2  
    55It works in the second case because the whole deferred `city_id` query retrieval happens before the `restaurant` caching happens to the `refresh_from_db(fieds=["city_id"])` cache clear has to effect.
    66`
    7 The only solution in 4.2 is to include `city` in your select mask (like you'd want to do anyway to avoid a N+1) to avoid the bugged `refresh_from_db` call.
     7The only solution in 4.2 is to include `city` in your select mask (like you'd want to do anyway to avoid a N+1) to avoid the bugged `refresh_from_db` call. This makes be think that `prefetch_related` + `only`/`defer` misuse error like we do with `select_related` might be valuable as opposed to silently including the fields as suggested by #35044.
Back to Top