Re: can't get m2m_changed signal working

2010-09-14 Thread Jason
Not sure it'll help but I've always used the 'sender' kwarg (I've used it a total of once to be fair): for example: m2m_changed.connect(update_answer_set_num_answers, sender=AnswerSet.answers.through) On Sep 14, 11:43 am, allyb wrote: > hi, > > yes, it is called in models.py, and no, it's not i

Re: can't get m2m_changed signal working

2010-09-14 Thread allyb
hi, yes, it is called in models.py, and no, it's not indented and neither is the handler function. On Sep 14, 4:28 pm, Jason wrote: > Is the m2m_changed() call in the models.py? > > Also, it looks indented - if it is, it shouldn't be - in other words - > it doesn't belong to the model. > > On Se

Re: can't get m2m_changed signal working

2010-09-14 Thread allyb
hi, yes, it is called in models.py, and no, it's not indented and neither is the handler function. On Sep 14, 4:28 pm, Jason wrote: > Is the m2m_changed() call in the models.py? > > Also, it looks indented - if it is, it shouldn't be - in other words - > it doesn't belong to the model. > > On Se

Re: can't get m2m_changed signal working

2010-09-14 Thread Jason
Is the m2m_changed() call in the models.py? Also, it looks indented - if it is, it shouldn't be - in other words - it doesn't belong to the model. On Sep 13, 1:27 pm, allyb wrote: > I'm finding it difficult to denormalise a field in a django model. I > have: > >     class AnswerSet(models.Model)

can't get m2m_changed signal working

2010-09-13 Thread allyb
I'm finding it difficult to denormalise a field in a django model. I have: class AnswerSet(models.Model): title = models.CharField(max_length=255) num_answers = models.PositiveIntegerField(editable=False, default=0) answers = models.ManyToManyField(Answer, through='Answ