Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-07-24 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
-+-
 Reporter:  Devin Cox|Owner:  Devin Cox
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  5.0
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

 In [changeset:"cd0479ff764272add5e0aba2afcf5649a241ca00" cd0479f]:
 {{{#!CommitTicketReference repository=""
 revision="cd0479ff764272add5e0aba2afcf5649a241ca00"
 Fixed #35331 -- Updated dropdown lists with entries added via the '+' sign
 from M2M field.
 }}}
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190e8a9a102-dac6780b-80b3-44a7-9855-0f8f9873b755-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-07-24 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
-+-
 Reporter:  Devin Cox|Owner:  Devin Cox
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by Sarah Boyce):

 * stage:  Accepted => Ready for checkin

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190e896e7f1-d722b10d-b59c-48f9-95b4-deaed6d4c892-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-07-22 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by devin13cox):

 * needs_better_patch:  1 => 0

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190dcd32425-b9e2da55-e65d-4a3d-9758-55be936c1d6b-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-06-12 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by Sarah Boyce):

 * needs_better_patch:  0 => 1

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701900c46c1c6-d3b6ec88-c427-4fce-9b1d-62e51dbe0c33-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-06-06 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by devin13cox):

 * needs_better_patch:  1 => 0

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018fefde78ad-931b730d-50b5-41d8-a0b6-e727d6dac532-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-05-07 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by Sarah Boyce):

 * needs_better_patch:  0 => 1

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f52fe143a-f6cc57cc-1bd5-4cf6-9abb-51df26ce9c46-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-04-03 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by devin13cox):

 * needs_better_patch:  1 => 0

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ea55667ca-c3723401-7862-4375-a26a-d304994b8280-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-03-28 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by Natalia Bidart):

 * needs_better_patch:  0 => 1

Comment:

 [https://github.com/django/django/pull/18026#issuecomment-2025084882 Per
 PR comment]
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e851125d7-e705d0b0-2233-47c8-972d-703fc2f9ade3-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists.

2024-03-27 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by devin13cox):

 * has_patch:  0 => 1

Comment:

 https://github.com/django/django/pull/18026
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e815b0e74-c1a76646-0907-414a-8dd2-f120286ff3b7-00%40eu-central-1.amazonses.com.


Re: [Django] #35331: Adding a new related entry using the "+" sign from M2M field doesn't update lists. (was: When adding a new related entry using the "+" sign from M2M field, no other widgets get up

2024-03-25 Thread Django
#35331: Adding a new related entry using the "+" sign from M2M field doesn't 
update
lists.
---+--
 Reporter:  devin13cox |Owner:  devin13cox
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  1
---+--
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted
 * summary:
 When adding a new related entry using the "+" sign from M2M field, no
 other widgets get updated.
 =>
 Adding a new related entry using the "+" sign from M2M field doesn't
 update lists.


Old description:

> Related to Ticket #34789, PR https://github.com/django/django/pull/17897
>
> Models:
>

> {{{
> from django.db import models
>

> class State(models.Model):
> label = models.CharField(max_length=255)
>
> def __str__(self):
> return self.label
>

> class Transition(models.Model):
> source = models.ManyToManyField(State,
> related_name="transition_source")
> target = models.ForeignKey(State, related_name="transition_target",
> on_delete=models.CASCADE)
> }}}
>
> Admin:
>

> {{{
> from django.contrib import admin
>
> from .models import State, Transition
>

> class TransitionAdmin(admin.ModelAdmin):
> filter_horizontal = ['source']
>

> admin.site.register(State)
> admin.site.register(Transition, TransitionAdmin)
> }}}
>
> Steps to Reproduce:
>
> Add a `State` via the "+" on the M2M field to add to the `Chosen Source`
> column. We would expect the dropdown for the `Target` to contain the new
> value, but it does not.
>
> Resolution as suggested by @nessita on the provided PR:
>
> "For this, I tracked down the issue to the selector used in
> dismissAddRelatedObjectPopup to decide whether to call
> updateRelatedSelectsOptions or not. Basically the id used in the
> document.getElementById is wrong for the M2M widget (but correct for the
> single FK field, so we may need to fix the call site to pass the proper
> name)"
>

> {{{
> --- a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
> +++ b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
> @@ -119,7 +119,7 @@
>
>  function dismissAddRelatedObjectPopup(win, newId, newRepr) {
>  const name = removePopupIndex(win.name);
> -const elem = document.getElementById(name);
> +const elem = document.getElementById(name + '_from');
>  if (elem) {
>  const elemName = elem.nodeName.toUpperCase();
>  if (elemName === 'SELECT') {
> }}}

New description:

 Related to Ticket #34789, PR https://github.com/django/django/pull/17897

 Models:


 {{{
 from django.db import models


 class State(models.Model):
 label = models.CharField(max_length=255)

 def __str__(self):
 return self.label


 class Transition(models.Model):
 source = models.ManyToManyField(State,
 related_name="transition_source")
 target = models.ForeignKey(State, related_name="transition_target",
 on_delete=models.CASCADE)
 }}}

 Admin:


 {{{
 from django.contrib import admin

 from .models import State, Transition


 class TransitionAdmin(admin.ModelAdmin):
 filter_horizontal = ['source']


 admin.site.register(State)
 admin.site.register(Transition, TransitionAdmin)
 }}}

 Steps to Reproduce:

 Add a `State` via the "+" on the M2M field to add to the `Chosen Source`
 column. We would expect the dropdown for the `Target` to contain the new
 value, but it does not.

 Resolution as suggested by @nessita on the provided PR:

 "For this, I tracked down the issue to the selector used in
 dismissAddRelatedObjectPopup to decide whether to call
 updateRelatedSelectsOptions or not. Basically the id used in the
 document.getElementById is wrong for the M2M widget (but correct for the
 single FK field, so we may need to fix the call site to pass the proper
 name)"


 {{{
 --- a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
 +++ b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
 @@ -119,7 +119,7 @@

  function dismissAddRelatedObjectPopup(win, newId, newRepr) {
  const name = removePopupIndex(win.name);
 -const elem = document.getElementById(name);
 +const elem = document.getElementById(name + '_from');
  if (elem) {
  const elemName = elem.nodeName.toUpperCase();
  if (elemName === 'SELECT') {
 }}}

--
-- 
Ticket URL: 
Django 
The Web framework for per