﻿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
34744	Migration re-add constraints when check condition contains a dict_keys object.	bcail	David Sanders	"A CheckConstraint using dict_keys like this has an issue:
{{{
models.CheckConstraint(
        name='animal_values',
        check=models.Q(animal__in={'c': 'cat', 'd': 'dog'}.keys())
)
}}}

It continually creates migrations and prompts you to create another migration - it doesn't realize that the migration has already been generated and applied.

If I change it to a list like this, it works - the problem goes away:
{{{
models.CheckConstraint(
        name='animal_values',
        check=models.Q(animal__in=list({'c': 'cat', 'd': 'dog'}.keys()))
)
}}}

Should Django properly handle dict_keys, or should the docs say that they have to be converted to a list?"	Bug	closed	Migrations	dev	Normal	fixed		Adam Zapletal David Sanders	Ready for checkin	1	0	0	0	0	0
