I have my 3 models:
class POmaterial(models.Model):
material = models.ForeignKey(Material, on_delete=models.PROTECT)
UOM = models.ManyToManyField(UOM, null=True, blank=True)
PO = models.ForeignKey(PO, on_delete=models.PROTECT,blank=True, null=True)
class Material(models.Model):
############
######
class UOM(models.Model):
material = models.ForeignKey(Material, on_delete=models.PROTECT)
I have used ManytoMany field type in UOM in my POmaterial model since I want to be able to create my POMaterial for the same UOM few times if required however I saw a lot of times statements that it is not recommended to use ManyToMany relation in Django. I was wondering what are the alteatives in my case?
I don't like the idea of adding more then one UOM at the same time.
