Opened 18 years ago
Closed 18 years ago
#2725 closed enhancement (worksforme)
edit_inline forces core=True ... core=True forces every *shown* field to be filled in
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Concept:
A "Profile" can have multiple settings
class Profile(models.Model): name=CharField();
A "Setting" is a variable identifier, as associated value, and action
class Setting(models.Model): myprofile=ForeignKey(Profile,edit_inline=..); identifier=CharField(); value=CharField(); action=BooleanField()
So ...
"Admin -> Profile -> Add" shows the form with Profile files and a few Settings (e.g., 3)
But ...
Setting 1 = identifier: foo value: bar action: [X]
Setting 2 = identifier: aaa value: bbb action: [_]
Setting 3 = leave all fields empty
Problem:
Django *forces* you to fill in all the offered rows. The required 'core=True' in the setting members force this.
You cannot fulfill the core=True requirement by filling in most of the rows completely.
If you have 2 variables/values/actions, then you cannot save.
There should be a way to remove unwanted edit_inline children ... or allow submission of complete sets of children, but not all the sets offered by the interface.
Work around = set the admin to show only 1 at a time, and force the user to submit and change the Parent multiple times.
Perhaps the reporter was using
core=True
in the wrong fields.Using the following models:
I can add one or multiple Setting objects in the Add Profile page just fine, and clearing the
core=True
field removes the Setting object as expected.