Changes between Initial Version and Version 1 of Ticket #34160, comment 10
- Timestamp:
- Nov 16, 2022, 1:07:13 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34160, comment 10
initial v1 1 What I believe is happening here is that `F("inventory_count") + Value(1)` has its `output_field` resolved to `IntegerField` because it's the common base of `inventory_count` (which I assume is a `SmallIntegerField` since the models were not provided) .1 What I believe is happening here is that `F("inventory_count") + Value(1)` has its `output_field` resolved to `IntegerField` because it's the common base of `inventory_count` (which I assume is a `SmallIntegerField` since the models were not provided) and `Value(1)`. 2 2 3 3 While `CombinedExpression._resolve_output_field` resolving logic deals with subclassing properly `BaseExpression._resolve_output_field` [https://github.com/django/django/blob/2848e5d0ce5cf3c31fe87525536093b21d570f69/django/db/models/expressions.py#L327-L329 isn't smart enough] to resolve a mix of `IntegerField` subclasses to the largest denominator.