﻿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
4207	"The ""add a new record on the fly"" does not respect the ""limit_choices_to"":"	david@…	nobody	"If the 'nl_group' field is defined as

{{{
  nl_group = models.ForeignKey('self', limit_choices_to = {'o1type__exact': 'NL'}, null=True, blank=True)
}}}

Then the pop up window after clicking the 'green plus' sign has an o1type with its normal default value. This means that the relationship will be broken. The o1type should default to 'NL' so that the relationship is not broken.

For many of the possible values of ""limit_choices_to"" a correct default value may be inferred. Other possible simpler solutions include adding a new parameter: e.g.

onfly_add_defaults = {'o1type': 'NL'}

"		closed	contrib.admin	dev		duplicate			Unreviewed	0	0	0	0	0	0
