it seems add duplicate user object to friends set , return an empty pk_set. since the m2m_changed 'post_add' action received why did not return an pk_set
On May 22, 3:34 pm, terry <kitly...@gmail.com> wrote: > i have an model > > class People(models.Model): > friends = models.ManyToManyField(User, blank=True) > > and i use m2m_changed signal > > m2m_changed.connect(m2m_people_handle, People.friends.through) > > and the m2m_people_handle function is > > def m2m_people_handle(sender, instance, action, reverse, model, > pk_set, **kwargs): > if action == 'post_add': > print len(pk_set) > > when i tested in some where: people.friends.add(user) > > the m2m_people_handle function print len(pk_set) result is 0 > > what wrong with it? > > thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.