Re: [Django] #14832: Impossible to create inline objects if form validates but is unchanged

15 views
Skip to first unread message

Django

unread,
Jun 4, 2011, 11:38:54 PM6/4/11
to django-...@googlegroups.com
#14832: Impossible to create inline objects if form validates but is unchanged
------------------------------------+-------------------------------
Reporter: julien | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: contrib.admin
Version: 1.2 | Severity: Normal
Resolution: | Keywords: sprintdec2010
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
------------------------------------+-------------------------------
Changes (by julien):

* 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.

Django

unread,
Feb 10, 2014, 5:12:49 AM2/10/14
to django-...@googlegroups.com
#14832: Impossible to create inline objects if form validates but is unchanged
-------------------------------+------------------------------------

Reporter: julien | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.4

Severity: Normal | Resolution:
Keywords: sprintdec2010 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by wim@…):

* version: 1.2 => 1.4


--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:6>

Django

unread,
Feb 10, 2014, 5:13:09 AM2/10/14
to django-...@googlegroups.com
#14832: Impossible to create inline objects if form validates but is unchanged
-------------------------------+------------------------------------
Reporter: julien | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.4
Severity: Normal | Resolution:
Keywords: sprintdec2010 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by anonymous):

The problem still exists in Django 1.4.10

--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:7>

Django

unread,
Mar 2, 2023, 5:35:16 AM3/2/23
to django-...@googlegroups.com
#14832: Impossible to create inline objects if form validates but is unchanged
-------------------------------+------------------------------------
Reporter: Julien Phalip | Owner: nobody

Type: Bug | Status: new
Component: contrib.admin | Version: 1.4
Severity: Normal | Resolution:
Keywords: sprintdec2010 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------

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>

Django

unread,
Mar 18, 2023, 12:05:06 PM3/18/23
to django-...@googlegroups.com
#14832: Impossible to create inline objects if form validates but is unchanged
-------------------------------+------------------------------------
Reporter: Julien Phalip | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.4
Severity: Normal | Resolution:
Keywords: sprintdec2010 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by Gustutu):

I also need this feature :)

--
Ticket URL: <https://code.djangoproject.com/ticket/14832#comment:9>

Django

unread,
Mar 19, 2023, 7:17:36 AM3/19/23
to django-...@googlegroups.com
#14832: Impossible to create inline objects if form validates but is unchanged
-------------------------------+------------------------------------
Reporter: Julien Phalip | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.4
Severity: Normal | Resolution:
Keywords: sprintdec2010 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages