Changes between Version 3 and Version 4 of Ticket #35442, comment 6


Ignore:
Timestamp:
May 10, 2024, 6:01:42 PM (4 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35442, comment 6

    v3 v4  
    4343             # Add the known related objects to the model.
    4444-            for field, rel_objs, rel_getter in known_related_objects:
    45 +            for field, rel_objs, attnames, rel_getter in known_related_objects:
     45+            for field, rel_objs, rel_attnames, rel_getter in known_related_objects:
    4646                 # Avoid overwriting objects loaded by, e.g., select_related().
    4747                 if field.is_cached(obj):
     
    4949+                # Avoid fetching potentially deferred attributes that would
    5050+                # result in unexpected queries.
    51 +                if any(attname not in obj.__dict__ for attname in attnames):
     51+                if any(attname not in obj.__dict__ for attname in rel_attnames):
    5252+                    continue
    5353                 rel_obj_id = rel_getter(obj)
Back to Top