﻿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
33916	default does not work for enums with flags if two or more items are used.	Willem Van Onsem	nobody	"If we work with a field:


{{{
regex_flags = models.IntegerField(default=re.UNICODE | re.IGNORECASE)
}}}

This is turned into a migration with:

{{{
default=re.RegexFlag[None]
}}}

This is due to the fact that the `EnumSerializer` aims to work with the `.name` of the item, but if there is no single item for the given value, then there is no such name.

In that case, we can use `enum._decompose` to obtain a list of names, and create an expression to create the enum value by ""ORing"" the items together."	Uncategorized	new	Migrations	4.0	Normal				Unreviewed	1	0	0	0	0	0
