I am creating a model in Django, but quite confuse about the type of field should i take:
Problem: I have to access multiple domains in one web classification, advice me please how do i make these field relationship so that if I try to get one web classification details then it will also contain list of related domain in that as well.
Model.py:
class WebClassification(models.Model):
vendor_id = models.ForeignKey(Vendor, on_delete=models.CASCADE, default=None, null=True)
id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=100)
description = models.CharField(max_length=1000)
domain_name = models.[what type i take here]
def __str__(self):
return self.name
Domain.py
class Domain(models.Model):
id = models.IntegerField()
domain_name = models.CharField(max_length=200)
def __str__(self):
return self.domain_name