{{{
@receiver(signals.m2m_changed, sender=models.Exam.questions.through)
def exam_questions_change(sender, instance, action, reverse, model,
pk_set, using, **kwargs):
print(repr(model))
print(model.___class___)
print(isinstance(model, models.Question))
}}}
And it gives me the following output
{{{
<class 'App.models.Question'>
<class 'django.db.models.base.ModelBase'>
False
}}}
What is going on here?
--
Ticket URL: <https://code.djangoproject.com/ticket/28978>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
Ticket URL: <https://code.djangoproject.com/ticket/28978#comment:1>
* status: new => closed
* resolution: => needsinfo
Comment:
We'll need more information to tell if there is some Django issue worth
investigating here:
What do you expect to see in that ''model'' parameter?
And a description of the M2M model setup would be great. Bonus points if
you can provide a minimal project showing the issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/28978#comment:2>
Comment (by Dev Aggarwal):
Replying to [comment:2 Ramiro Morales]:
> We'll need more information to tell if there is some Django issue worth
investigating here:
>
> What do you expect to see in that ''model'' parameter?
>
> And a description of the M2M model setup would be great. Bonus points if
you can provide a minimal project showing the issue.
Thanks for the reply.
I figured out what the problem was. I thought that model was an instance
but it was the actual class of my model
doing this produced the required behavior :)
{{{
>> model == models.Question
True
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28978#comment:3>
* resolution: needsinfo => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/28978#comment:4>
* resolution: fixed => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/28978#comment:5>