I have a scenario where I have a model "Thread". There are two fields in it. "Sender" and "receiver". Also there are other models like "Teacher", "Student", "Principal" etc.
Now in the "Thread" model, the sender can be a "Student", and receiver can be a "Teacher" OR Vice Versa. What is the solution for that:
class Thread(models.Model):
sender = models.(???) # can't be a student relation because a sender can be a teacher too
receiver = models.(???) # same here.
Is there any way that I can dynamically first select the model and then pick an object of that list. I have seen this functionality in Odoo. But is there anything in Django?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…