﻿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
12722	Models having selects with optgroups per Ticket #4412 no longer validate reliably	thiggins	nobody	"Since Ticket #4412, nested choice structures have been permitted. This results in optgroups. The example that was given is reproduced here with one additional line:
{{{
choices = (
        ('outer1', 'Outer 1'),
        ('Group 1', (
                ('inner1', 'Inner 1'),
                ('inner2', 'Inner 2'),
                ('outer1', 'Outer 1'),
            )
        )
    )
}}}

In the development version, currently (version 1.2 alpha 1 SVN-12314), nested choice structures such as this still generate valid HTML, but associated models fail to validate unless the selection is from the 'outer' category, or happens to have the same value as a selection from the outer category (such as the line I added). Otherwise a default validation error message, such as 'Value u'inner1' is not a valid choice' is generated.

Let me point out that, in order to generate the HTML shown in #4412, eliminating a blank choice, one must follow the usage given 11/07/07 by semenov in Ticket #4653
using a combination of an explicit blank=False and a declared default value.
"		closed	Uncategorized	1.2-alpha		duplicate	model-validation, choices, optgroups		Unreviewed	0	0	0	0	0	0
