#33029: Can't open multiple Django Admin Popups for the same related field.
-----------------------------------+--------------------------------------
Reporter: Yash Jhunjhunwala | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-----------------------------------+--------------------------------------
Changes (by Carlton Gibson):
* status: new => closed
* resolution: => wontfix
Old description:
> Django Admin shows popup for adding/editing a related field object. The
> popup doesn't always a new popup but instead replaces the current one
> when opening multiple popups.
>
> Steps to recreate the problem:
>
> For E.g.
>
> {{{
> class A(models.Model):
> foo = models.ForeignKey('self',
> on_delete=models.SET_NULL,null=True,blank=True,verbose_name="If
> True",related_name="foo_set",)
> bar = models.ForeignKey('self',
> on_delete=models.SET_NULL,null=True,blank=True,verbose_name="If
> True",related_name="bar_set",)
> }}}
>
> For the above Model A :
>
> Create a new instance of model A using the admin. Open a relatedmodel
> popup for foo by clicking on the add sign.
> In the new pop up click on the add sign for foo again and it will replace
> the current popup (instead of opening up another popup) whereas if you
> click on the add sign for bar it will open another popup - which is the
> expected behavior.
New description:
Django Admin shows popup for adding/editing a related field object. The
popup doesn't always a new popup but instead replaces the current one when
opening multiple popups.
Steps to recreate the problem:
For E.g.
{{{
class A(models.Model):
foo = models.ForeignKey('self',
on_delete=models.SET_NULL,null=True,blank=True,verbose_name="If
True",related_name="foo_set",)
bar = models.ForeignKey('self',
on_delete=models.SET_NULL,null=True,blank=True,verbose_name="If
True",related_name="bar_set",)
}}}
For the above Model A :
Create a new instance of model A using the admin. Open a relatedmodel
popup for foo by clicking on the add sign.
In the new pop up click on the add sign for foo again and it will replace
the current popup (instead of opening up another popup) whereas if you
click on the add sign for bar it will open another popup - which is the
expected behavior.
--
Comment:
Hi. Thanks for the report.
I'm going to say wontfix here.
In the normal case this works as expected. I'm adding a new object for a
foreign key; I click the same + button; I can't add two objects to the
same FK, so the popup is replaced; meanwhile, if I click the + for a
second related field a new popup is created (since I can add two different
objects to two different FKs).
The case for `self` is more complex, since in principle I could add a
chain of models for the same FK, but each on a different instance.
However, without a candidate implementation it's not clear it's worth
additional complexity to the popup implementation to handle that case.
(You can simply build the chain in the other direction.)
Happy to reopen if you want to work on an implementation that's not too
complex though!
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/33029#comment:1>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/061.ff4f12e39f810b565dd42f9c58e2f39b%40djangoproject.com.