mirror of
https://github.com/django/django.git
synced 2025-08-22 03:24:21 +00:00
[5.0.x] Fixed #34858 -- Corrected resolving output_field for PositiveIntegerField.
Regression in40b8a6174f
. Backport of4de31ec680
from main
This commit is contained in:
parent
88992c5ac6
commit
dcd3a0316b
3 changed files with 38 additions and 0 deletions
|
@ -512,6 +512,25 @@ class Expression(BaseExpression, Combinable):
|
|||
|
||||
_connector_combinations = [
|
||||
# Numeric operations - operands of same type.
|
||||
# PositiveIntegerField should take precedence over IntegerField (except
|
||||
# subtraction).
|
||||
{
|
||||
connector: [
|
||||
(
|
||||
fields.PositiveIntegerField,
|
||||
fields.PositiveIntegerField,
|
||||
fields.PositiveIntegerField,
|
||||
),
|
||||
]
|
||||
for connector in (
|
||||
Combinable.ADD,
|
||||
Combinable.MUL,
|
||||
Combinable.DIV,
|
||||
Combinable.MOD,
|
||||
Combinable.POW,
|
||||
)
|
||||
},
|
||||
# Other numeric operands.
|
||||
{
|
||||
connector: [
|
||||
(fields.IntegerField, fields.IntegerField, fields.IntegerField),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue