Re: [Django] #11803: Admin does not update every ForeignKey select of the same model

32 views
Skip to first unread message

Django

unread,
Mar 20, 2012, 6:53:40 AM3/20/12
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: nobody
<danilo.cabello@…> | Status: new
Type: Bug | Version: 1.1
Component: contrib.admin | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: admin select | Needs documentation: 0
foreignkey | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by googol):

I'd like to vote for this feature as it is crucial for our projects.
Without it customers have to edit the entities first (City) they will
refer to in other models (Person) which is very bad from a usability point
of view!

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

Django

unread,
May 12, 2012, 11:47:21 AM5/12/12
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: nobody
<danilo.cabello@…> | Status: new
Type: Bug | Version: 1.1
Component: contrib.admin | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: admin select | Needs documentation: 0
foreignkey | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by roland):

second vote

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

Django

unread,
Jan 10, 2017, 4:26:14 PM1/10/17
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: nobody
<danilo.cabello@…> |
Type: Bug | Status: new
Component: contrib.admin | Version: 1.1
Severity: Normal | Resolution:
Keywords: admin select | Triage Stage: Accepted
foreignkey |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adonys Alea Boffill):

* cc: aaboffill@… (added)


Comment:

I think that is a little difficult to find a simple and elegant way to fix
this ticket.
The `Select` fields are updated in `RelatedObjectLookups.js` when the
popup is closed after to add the new record. In order to update all fields
related with the same `model`, is necessary to have at least something to
identify all `HTML` elements with the same `model`, something like `data-
model-ref=""`. Now this is a little more easy with the new `template-based
widget rendering`, because is easy to add the attribute to the `template`.
But to make this simple change in the template, is necessary to update all
tests related with the html content of widgets. And I don't know if to
add a new attribute to the field widget template it's finally convenient
or worthwhile.

If finally to add something like `data-model-ref=""` in the field widget
template is not a bad idea, I can work on a solution.

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

Django

unread,
Jan 26, 2022, 9:17:20 AM1/26/22
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: Marcelo
<danilo.cabello@…> | Galigniana
Type: Bug | Status: assigned

Component: contrib.admin | Version: 1.1
Severity: Normal | Resolution:
Keywords: admin select | Triage Stage: Accepted
foreignkey |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* owner: nobody => Marcelo Galigniana
* status: new => assigned


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

Django

unread,
Jan 26, 2022, 5:31:48 PM1/26/22
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: Marcelo
<danilo.cabello@…> | Galigniana
Type: Bug | Status: assigned
Component: contrib.admin | Version: 1.1
Severity: Normal | Resolution:
Keywords: admin select | Triage Stage: Accepted
foreignkey |
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


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

Django

unread,
Jan 26, 2022, 9:33:45 PM1/26/22
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: Marcelo
<danilo.cabello@…> | Galigniana
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev

Severity: Normal | Resolution:
Keywords: admin select | Triage Stage: Accepted
foreignkey |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Asif Saifuddin Auvi):

* version: 1.1 => dev


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

Django

unread,
Feb 16, 2022, 4:28:38 AM2/16/22
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: Marcelo
<danilo.cabello@…> | Galigniana
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin select | Triage Stage: Accepted
foreignkey |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


Comment:

The suggest patch looks kind of neat, so 👍
I think `limit_choices_to` (and maybe other wiggles) need consideration
for it to be 100%

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

Django

unread,
Apr 13, 2022, 9:29:13 AM4/13/22
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: Marcelo
<danilo.cabello@…> | Galigniana
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: admin select | Triage Stage: Ready for
foreignkey | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

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


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

Django

unread,
Apr 15, 2022, 2:52:57 AM4/15/22
to django-...@googlegroups.com
#11803: Admin does not update every ForeignKey select of the same model
-------------------------------------+-------------------------------------
Reporter: danilo | Owner: Marcelo
<danilo.cabello@…> | Galigniana
Type: Bug | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed

Keywords: admin select | Triage Stage: Ready for
foreignkey | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"c72f6f36c13a21f6db3d4f85d2d3cec87bad45e6" c72f6f3]:
{{{
#!CommitTicketReference repository=""
revision="c72f6f36c13a21f6db3d4f85d2d3cec87bad45e6"
Fixed #11803 -- Allowed admin select widgets to display new related
objects.

Adjusted admin javascript to add newly created related objects to
already loaded select widgets.

In this version, applies only where limit_choices_to is not set.
}}}

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

Reply all
Reply to author
Forward
0 new messages