﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30505	Ordering of Field.choices is significant for makemigrations	Marnanel Thurman	Caio Ariede	"makemigrations regards the ordering of Field.choices as significant. The docs require Field.choices to be an iterable, but not to be well-ordered. If Field.choices is not well-ordered, then almost every run of makemigrations will treat the model as changed, even without changes to the code.

The ordering of Field.choices is not significant anywhere else, except as a cosmetic detail in the admin.

This bug even occurs in
{{{
ACTIVITY_TYPES = set(['Create', 'Update', 'Delete'])

[....]
    f_type = models.CharField(
            max_length=255,
            choices=[(x,x) for x in ACTIVITY_TYPES],
            )
}}}

I would have expected the value of Field.choices here to be well-ordered (and sorted) but makemigrations still flags this as changed every time.

I can put a test case together if you like."	Cleanup/optimization	closed	Migrations	dev	Normal	fixed		Carlton Gibson	Accepted	1	0	0	0	0	0
