django-nested-inline icon indicating copy to clipboard operation
django-nested-inline copied to clipboard

Extra level 3 field on new level 2

Open nexusdk opened this issue 10 years ago • 0 comments

Pip freeze: Django==1.8.3 django-admin-bootstrapped==2.5.4 django-better-filter-widget==0.4 django-bootstrap3==6.1.0 django-nested-inline==0.3.5 wheel==0.24.0

My admin:

class MultipleChoiceOptionInlineAdmin(nested_admin.NestedStackedInline): model = MultipleChoiceOption extra = 0 formfield_overrides = { models.TextField: {'widget': AdminTextInputWidget} }

class ComprehensionQuestionInlineAdmin(nested_admin.NestedStackedInline): model = ComprehensionQuestion extra = 0 inlines = [MultipleChoiceOptionInlineAdmin]

class LessonAdmin(nested_admin.NestedModelAdmin): form = LessonForm inlines = [ ComprehensionQuestionInlineAdmin ]

When I add another Comprehension Question if one with MultipleChoiceOptions already exists, then it also has the "add another Mutliple Choice Option link and one blank Multiple Choice Option Field. The users then adds many Multiple Choice Options to the unsaved Comprehension Question. Upon clicking the Save button, the page simply jumps to the top without saving the model. I assume this is because the Comprehension Question does not exist yet.

Not sure if I messed up somewhere. If this is not a bug, please advise.

nexusdk avatar Sep 12 '15 09:09 nexusdk