Django admin add popup not working with many-to-many attribute on itself

49 views Asked by At

Im trying to use in django admin a simple model like this:

class Model1(models.Model):

    value = models.CharField(max_length=100)
    valuem2m = models.ManyToManyField("Model1", related_name="model1", blank=True)

When try to add values in admin, if I try to open more than 1 popup, it didn't open another window, only redirect to the next form. first emergent window When I save this gives me this error.

pup_response.js:13 Uncaught TypeError: opener.dismissAddRelatedObjectPopup is not a function
    at popup_response.js:13:16

window broken

This is because the autogenerated id of the add button is the same of the child add button. (add_id_valuem2m). DevTools id's

There is a way to make this work?

0

There are 0 answers