Buggy Migrations when `float("nan")` in `Q` objects
— at Version 3
When creating a CheckConstraint in the form
class MyModel(Model):
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").
See PR: https://github.com/django/django/pull/14706
Change History
(3)
| Description: |
modified (diff)
|
| Summary: |
Buggy Migrations when `flota("nan")` in `Q` objects → Buggy Migrations when `float("nan")` in `Q` objects
|
| Cc: |
Steven Jin added
|
| Description: |
modified (diff)
|
| Has patch: |
set
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|