Changes between Initial Version and Version 1 of Ticket #37237, comment 11
- Timestamp:
- Jul 30, 2026, 7:10:58 AM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37237, comment 11
initial v1 6 6 7 7 1. [https://github.com/django/django/blob/274a1d494d11d87a1b767340d1f398f197810f93/django/db/models/fields/related_lookups.py#L56 It calls] the `get_normalized_value` [https://github.com/django/django/blob/274a1d494d11d87a1b767340d1f398f197810f93/django/db/models/fields/related_lookups.py#L15-L39 function] which results in two `isinstance` checks and [https://github.com/django/django/blob/274a1d494d11d87a1b767340d1f398f197810f93/django/db/models/fields/related_lookups.py#L15-L39 an unnecessary] `tuple` creation (as the first member is always taken) for each member of `values`. 8 2. It [https://github.com/django/django/blob/274a1d494d11d87a1b767340d1f398f197810f93/django/db/models/fields/related_lookups.py#L68 then calls] `target_field.get_prep_value` for each member values` but that's something `lookups.In` via `FieldGetDbPrepValueIterableMixin` which means we're doing it twice in this case since we don't mark `self.prepare_rhs = False`.8 2. It [https://github.com/django/django/blob/274a1d494d11d87a1b767340d1f398f197810f93/django/db/models/fields/related_lookups.py#L68 then calls] `target_field.get_prep_value` for each member of `values` but that's something `lookups.In` via `FieldGetDbPrepValueIterableMixin` which means we're doing it twice in this case since we don't mark `self.prepare_rhs = False`.