#31683: Overridden methods ignored in models.DecimalField subclass
-------------------------------------+-------------------------------------
Reporter: Max Rothman | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: custom-model-fields | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):
* status: new => closed
* resolution: => invalid
* severity: Release blocker => Normal
Comment:
Overriding works fine. `DecimalField` doesn't call `get_prep_value()` on
`.save()` because it has a custom `get_db_prep_save()` implementation:
{{{
>>> Field1().get_prep_value('asdasd')
ZeroDivisionError: division by zero
>>> TestModel1.objects.filter(m='3.44')
ZeroDivisionError: division by zero
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31683#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.d5e4d06a929eec9f35d5058356ddf605%40djangoproject.com.