﻿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
35982	DecimalField.get_db_prep_value() doesn't call adapt_decimalfield_value()	Tim Graham	Tim Graham	"Some built-in fields have corresponding `DatabaseOperations.adapt_<field_name>_value()` methods. For all of these fields except `DecimalField`, `get_db_prep_value()` calls the corresponding ""adapt"" method.

`DecimalField`, however, was changed in e9814029f570bd0866dc859147bca90340bcc913 to call `adapt_decimalfield_value()` in `get_db_prep_save()`. This causes decimal values not to be converted when needed for query lookups (see [https://github.com/mongodb-labs/django-mongodb/blob/36c57187de430ab4313e8db5c3ce8ab2ab569f5b/django_mongodb/operations.py#L182-L202 hacky workaround in django-mongodb)].

The issue also manifested when adapting `ArrayField` for MongoDB. The lack of a proper `DecimalField.get_db_prep_value()` means [https://github.com/django/django/blob/c075d4c2c8cef3c9b28180c749d421c63544a9dd/django/contrib/postgres/fields/array.py#L126-L132 Decimals aren't prepared properly]."	Bug	closed	Database layer (models, ORM)	5.1	Normal	fixed			Ready for checkin	1	0	0	0	0	0
