I have 2 models model A and model B as below
class ModelA(TimeStampedModel):
field_a= models.TextField(default="")
field_b= models.ManyToManyField("ModelB",
related_name="modeA_modelB", blank=True)
class ModelB(TimeStampedModel):
field_c= models.TextField(default="")
field_d= models.ManyToManyField("ModelA",
related_name="modeB_modelA", blank=True)
What I'm trying to achieve is whenever a model A is assigned to model B instance it should reflect in model B as well.
For example: A particular terms and conditions have several policy that will be model A, next in model B, I need to have field _d having the list of terms and condition which have that policy.