Changes between Initial Version and Version 1 of Ticket #31420, comment 4
- Timestamp:
- Apr 3, 2020, 12:39:45 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31420, comment 4
initial v1 5 5 This happens to be `Col.field` https://github.com/django/django/blob/89032876f427a77ab4de26493190280377567d1c/django/db/models/sql/query.py#L235-L236 6 6 7 Now `Col.field` is actually `Expression.field` which is actually an alias for `.output_field` (not sure why) but in order to allow the special related field lookup conversion of `SimpleLazyObject` to model instance (e.g. needed for stuff like `.filter(user=request.user)` where `request.user` is a `SimpleLazyObject`) it's the `Col.target` that should be used as `output_field` .7 Now `Col.field` is actually `Expression.field` which is actually an alias for `.output_field` (not sure why) but in order to allow the special related field lookup conversion of `SimpleLazyObject` to model instance (e.g. needed for stuff like `.filter(user=request.user)` where `request.user` is a `SimpleLazyObject`) it's the `Col.target` that should be used as `output_field` and not `Col.field`. 8 8 9 9 {{{#!diff … … 22 22 }}} 23 23 24 The suite seems to agree from my local testing.