#26560: m2m_changed signal does not fire in django admin when using inlines
-------------------------+-------------------------------------------------
     Reporter:  nodet07  |      Owner:  Iman Mirzadeh
         Type:           |     Status:  new
  Uncategorized          |
    Component:           |    Version:  1.8
  contrib.admin          |   Keywords:  m2m_changed djang_admin
     Severity:  Normal   |  admin_inline
 Triage Stage:           |  Has patch:  0
  Unreviewed             |
Easy pickings:  0        |      UI/UX:  0
-------------------------+-------------------------------------------------
 in django admin if we use inline(tabular or stacked) for many to many
 field, after editing it on admin the m2m_changed signal does not fire !!
 if we use normal fields it works


 {{{
 #models.py
 class TestModel(models.Model):
     name = models.CharField(max_length = 100)
     events = models.ManyToManyField(Event,related_name="testmodels")

 #admin.py
 @admin.register(TestModel)
 class TestModelAdmin(admin.ModelAdmin):
     list_display = ("__unicode__","name")
     inlines = [EventInline,]
     exclude = ('events',)
 }}}

 but when I change it to

 {{{
 @admin.register(TestModel)
 class TestModelAdmin(admin.ModelAdmin):
     list_display = ("__unicode__","name")
 }}}

 it works fine and signal triggered !
 actually I found that the main problem is :
 {{{
     exclude = ('events',)
 }}}
 But this is a bug because when we add something inline in admin using m2m
 relationship,the signal does not fire!!

--
Ticket URL: <https://code.djangoproject.com/ticket/26560>
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/050.f69e58e8d7935968d1f64350e813638a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to