Opened 11 years ago
Closed 11 years ago
#24521 closed Bug (fixed)
frozensets don't seem to work quite right in migrations as field kwargs
| Reported by: | ris | Owned by: | nobody |
|---|---|---|---|
| Component: | Migrations | Version: | 1.7 |
| Severity: | Normal | Keywords: | migration kwarg frozenset |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Apologies if this is a rather sparse bug report, but I think it's quite a straightforward issue to explain.
Using django 1.7.7, a custom model field returning a frozenset as a value in the kwargs dict from deconstruct will cause makemigrations to seemingly coerce this value to a tuple. Because this tuple does not exactly equal the frozenset, this trips up makemigrations' change detection logic, and this will get detected as a "change" each and every time makemigrations is run for eternity.
Use of a set however works as expected, so this is a bit odd.
Change History (3)
comment:1 by , 11 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 11 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
PR here: https://github.com/django/django/pull/4387