[Django] #28357: Prepopulated_fields doesn't work for admin.StackedInline

30 views
Skip to first unread message

Django

unread,
Jul 3, 2017, 11:33:08 AM7/3/17
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
ChristosKon |
Type: Bug | Status: new
Component: | Version: 1.11
contrib.admin | Keywords: admin,
Severity: Normal | stackedinline, prepopulated_fields
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I think that I found a bug (new to Django)

Prepopulated_fields doesn't work for StackedInline class while it works
fine for TabularInline class.

Please let me know if you need any more information.

--
Ticket URL: <https://code.djangoproject.com/ticket/28357>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 3, 2017, 12:19:03 PM7/3/17
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution:
Keywords: admin, | worksforme
stackedinline, | Triage Stage:
prepopulated_fields | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => worksforme


Comment:

I tested with a a simple project and couldn't reproduce a problem. Please
provide more details.

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:1>

Django

unread,
Mar 11, 2019, 9:54:52 PM3/11/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage:
stackedinline, | Unreviewed
prepopulated_fields |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Siemens):

* cc: Ryan Siemens (added)
* status: closed => new
* version: 1.11 => 2.1
* resolution: worksforme =>


Comment:

Reopening as I ran into this issue (at least similar) today. Some
additional info:

The `prepopulated_fields` will work for the `extra` forms specified, in
the inline, but any additional forms added via "Add another <Model>" will
not run the js that pre populates the field.

Verified this issue is happening in 2.1 and 1.11 and attached a minimal
project that reproduces the issue.

To reproduce:
1. extract the attached project
2. run the migrations
3. create a superuser
4. navigate to `admin/myapp/blog/add/`
5. adding a title to extra forms in the the stacked inline articles
prepopulates the slug field
6. click "Add another Article"
7. ASSERT adding a title the newly added stacked inline article form does
**not** prepopulate the slug field

Here is a screen grab showing the results of steps 5-7
https://zappy.zapier.com/22F716E5-1D64-4763-B731-DE62D24F8FC0.mp4

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:2>

Django

unread,
Mar 11, 2019, 9:55:42 PM3/11/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: nobody
Type: Bug | Status: new

Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage:
stackedinline, | Unreviewed
prepopulated_fields |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Siemens):

* Attachment "prepopulated-issue.tar.gz" added.

Minimal project to reproduce issue

Django

unread,
Mar 11, 2019, 9:57:20 PM3/11/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: nobody
Type: Bug | Status: new

Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage:
stackedinline, | Unreviewed
prepopulated_fields |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1

-------------------------------------+-------------------------------------
Changes (by Ryan Siemens):

* ui_ux: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:3>

Django

unread,
Mar 11, 2019, 11:06:51 PM3/11/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: nobody
Type: Bug | Status: new

Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* stage: Unreviewed => Accepted


Comment:

Thanks for the very detailed reproduction case Ryan.

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:4>

Django

unread,
Apr 13, 2019, 6:51:30 AM4/13/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Jakob
| Köhler
Type: Bug | Status: assigned

Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Jakob Köhler):

* status: new => assigned
* owner: nobody => Jakob Köhler


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:5>

Django

unread,
Jul 9, 2019, 6:36:36 AM7/9/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.

-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Jakob
| Köhler
Type: Bug | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by felixxm):

* has_patch: 0 => 1
* version: 2.1 => master


Comment:

[https://github.com/django/django/pull/11221 PR]

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

Django

unread,
Jul 9, 2019, 7:04:07 AM7/9/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Jakob
| Köhler
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_tests: 0 => 1


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

Django

unread,
Nov 20, 2019, 6:39:28 PM11/20/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Jakob
| Köhler
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Jakob Köhler):

* needs_tests: 1 => 0


Comment:

I added a test for the scenario defined by Ryan ✅

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:8>

Django

unread,
Dec 13, 2019, 3:23:26 PM12/13/19
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Jakob
| Köhler
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


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

Django

unread,
Apr 15, 2021, 2:01:28 AM4/15/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Jakob
| Köhler
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev

Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by David Smith):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:10>

Django

unread,
Aug 14, 2021, 10:31:01 AM8/14/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: (none)
Type: Bug | Status: new

Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by David Smith):

* owner: Jakob Köhler => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:11>

Django

unread,
Aug 20, 2021, 3:05:14 AM8/20/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: 1arshan
Type: Bug | Status: assigned

Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by 1arshan):

* owner: (none) => 1arshan


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:12>

Django

unread,
Aug 21, 2021, 3:30:52 AM8/21/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: (none)
Type: Bug | Status: new

Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by ARSHAN AHMAD):

* owner: ARSHAN AHMAD => (none)


* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:13>

Django

unread,
Sep 24, 2021, 1:37:40 AM9/24/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner:
| Deepchavan1
Type: Bug | Status: assigned

Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Deepchavan1):

* owner: (none) => Deepchavan1


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:14>

Django

unread,
Oct 10, 2021, 6:27:15 AM10/10/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Zoltán
| Szatmáry

Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Zoltán Szatmáry):

* cc: Zoltán Szatmáry (added)
* owner: Deepchavan1 => Zoltán Szatmáry


Comment:

Yeseterday I made a PR for this one.
[https://github.com/django/django/pull/14967]
It only required changes in the **inlines.js** file.

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:15>

Django

unread,
Oct 13, 2021, 3:46:48 AM10/13/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Zoltán
| Szatmáry
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:16>

Django

unread,
Nov 15, 2021, 9:51:33 AM11/15/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar

Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Shubh Parmar):

* owner: Zoltán Szatmáry => Shubh Parmar


Comment:

Since there is no updates regarding this ticket for weeks, I want to work
on it.

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:17>

Django

unread,
Nov 15, 2021, 9:52:48 AM11/15/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Shubh Parmar):

* cc: Shubh Parmar (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:18>

Django

unread,
Nov 15, 2021, 10:35:02 AM11/15/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Shubh Parmar):

PR: [https://github.com/django/django/pull/15091]

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:19>

Django

unread,
Nov 16, 2021, 1:57:06 AM11/16/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1

-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => assigned
* needs_better_patch: 1 => 0


* needs_tests: 1 => 0

* easy: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:20>

Django

unread,
Nov 16, 2021, 3:31:54 AM11/16/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Accepted
stackedinline, |
prepopulated_fields |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:21>

Django

unread,
Nov 16, 2021, 6:37:12 AM11/16/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin, | Triage Stage: Ready for
stackedinline, | checkin
prepopulated_fields |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:22>

Django

unread,
Nov 16, 2021, 2:35:31 PM11/16/21
to django-...@googlegroups.com
#28357: Prepopulated_fields doesn't work for admin.StackedInline.
-------------------------------------+-------------------------------------
Reporter: ChristosKon | Owner: Shubh
| Parmar
Type: Bug | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed

Keywords: admin, | Triage Stage: Ready for
stackedinline, | checkin
prepopulated_fields |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"bb223c6f78afb94f4305fca945f54b8603bb0105" bb223c6]:
{{{
#!CommitTicketReference repository=""
revision="bb223c6f78afb94f4305fca945f54b8603bb0105"
Fixed #28357 -- Fixed ModelAdmin.prepopulated_fields on newly added
stacked inline.

Thanks Jakob Köhler for the initial patch.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28357#comment:23>

Reply all
Reply to author
Forward
0 new messages