* easy: => 0
Comment:
#11807 reported the same issue, contains a detailed analysis by kmtracey
and has a test case.
--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* version: 1.2 => 1.4
--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:6>
Comment (by anonymous):
The problem still exists in Django 1.4.10
--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:7>
Comment (by David):
After about 14 years after the first report (#11807) this issue is still
present.
I belive that this may be addressed with a change in the APIs in inline
admins and model-formset.
But first it must be defined a logic to handle this operation:
* **one-to-one** inline is easy, it should be created
* **many-to-one** inline is not so easy, since it depends on the
application context
* **many-to-many** inline should follow the same criteria as many-to-one
For these reasons I propose the following mechanism:
* add a new method to `InlineModelAdmin` which controls over the "create-
if-empty" mechanism, which should receive as params the main object and
count of already handled "empty" forms and which should return a boolean
(indicating if the empty form shall be created or not)
* add a new optional attribute to `BaseInlineFormSet` which is going to
hold a method like that described above
* override the `save_new_objects` in `BaseInlineFormSet` to handle the
abovementioned attribute and thus proceeding with the creation of "empty"
forms when confirmed.
--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:8>
Comment (by Gustutu):
I also need this feature :)
--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:9>
Comment (by Mariusz Felisiak):
Replying to [comment:9 gustutu]:
> I also need this feature :)
This kind of comments are not helpful. Please feel-free to prepare a patch
if you want it fixed in Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:10>