#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/091.654936aa678fc8c23ac6726af332d91c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.