Changes between Version 1 and Version 2 of Ticket #30771, comment 3
- Timestamp:
- Sep 12, 2019, 11:25:36 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30771, comment 3
v1 v2 5 5 https://github.com/django/django/blob/ea25bdc2b94466bb1563000bf81628dea4d80612/django/db/models/lookups.py#L265-L267 6 6 7 We probably don't want to perform the `clear_select_clause` and `add_fields(['pk'])` when the query is already only selecting a single field.7 We probably don't want to perform the `clear_select_clause` and `add_fields(['pk'])` when the query is already selecting fields. 8 8 9 9 That's exactly what `In.process_rhs` [https://github.com/django/django/blob/ea25bdc2b94466bb1563000bf81628dea4d80612/django/db/models/lookups.py#L356-L358 does already] by only performing these operations `if not getattr(self.rhs, 'has_select_fields', True)`.