﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31683	Overridden methods ignored in models.DecimalField subclass	Max Rothman	nobody	"Django: 2.2.4
Python: 3.6.9
Mysql: 5.6.47

It appears to be impossible to override any methods in subclasses of {{{models.DecimalField}}} under certain circumstances. Consider the following:

{{{#!python
class Field1(models.DecimalField):
    def get_prep_value(self, value):
        1/0

class Field2(models.PositiveIntegerField):
    def get_prep_value(self, value):
        1/0

class TestModel1(models.Model):
    m = Field1(max_digits=5, decimal_places=2)

class TestModel2(models.Model):
    m = Field2()

TestModel1(m=1).save()  # No error!
TestModel2(m=1).save()  # Error, as expected
}}}

I'd expect to get an error when saving {{{TestModel1}}} because get_prep_value should throw a {{{ZeroDivisionError}}}, but as far as I can tell, {{{Field1.get_prep_value}}} is never called.

This bug appears to be somewhat sensitive to platform conditions. I've been able to replicate it consistently on my machine, but another one of my colleagues who tried was not."	Bug	closed	Database layer (models, ORM)	2.2	Normal	invalid	custom-model-fields		Unreviewed	0	0	0	0	0	0
