#33954: "NaN" can be stored in DecimalField but cannot be retrieved -------------------------------------+------------------------------------- Reporter: Xabier Bello | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Database layer | Version: 4.1 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Mariusz Felisiak):
* status: closed => new * type: Bug => Cleanup/optimization * resolution: invalid => * stage: Unreviewed => Accepted Comment: > Notice that I'm using the Model validation, if I'm not mistaken and it refers to creating objects with `MyModel.objects.create` Not really, `.create()` and `.save()` don't call `full_clean()` (see [https://docs.djangoproject.com/en/4.1/ref/models/instances/#validating- objects docs]). We added extra guards in #33033 because on some databases (SQLite and PostgreSQL) `NaN` values are accepted without raising any database-level errors. I agree that we should add the same checks for `"nan"` strings. -- Ticket URL: <https://code.djangoproject.com/ticket/33954#comment:4> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070182d4507bd5-68adbcf6-ec16-4dac-9537-ffd79ae9074e-000000%40eu-central-1.amazonses.com.