#32967: Buggy Migrations when `flota("nan")` in `Q` objects
-------------------------------------+-------------------------------------
Reporter: Steven | Owner: Steven Jin
Jin |
Type: Bug | Status: assigned
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Normal | Keywords: db Q
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When creating a `CheckConstraint` in the form
{{{#!python
class MyModel
x = FloatField()
class Meta:
constraints = [~CheckConstraint(check=Q(x=float("nan")), name="some
constraint")]
}}}
This constraint is removed and added back every time `python manage.py
makemigrations` is run. This is because the inherited `__eq__` function of
`Q` objects does not take into account the fact that `float("nan") !=
float("nan")`.
--
Ticket URL: <https://code.djangoproject.com/ticket/32967>
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/053.d2df736657b975b78c44d61eb9febaf9%40djangoproject.com.