On Nessita’s advice, I’m here to gather information and opinions about the breakdown required for this PR (and the related ticket).
To handle the division operation depending on variable types, I had to propagate output_field
down to the backend files of each problematic DB (in this case SQLite, and after testing, PostgreSQL as well. MySQL doesn’t raise any error locally, and I don’t have the environment to test Oracle, but the CI came out green).
Then, I arbitrarily chose to handle the division case in combine_expression
, to avoid creating a method too specific and based solely on the divisor.
Also, I don’t have a full overview of the Django project — there might have been an upstream solution that could apply stricter logic based on type nature. However, when I saw that validating my tests caused regressions on test_right_hand_division
, I assumed that if such a mechanism exists, it might be imperfect. So I made the decision to fix the issue directly in combine_expression
.
How do the old-timers of the Django project see it?