class Professor(models.Model):
genders = (
("1", "M"),
("2", "F"),
("3", "O")
)
name = models.CharField(max_length = 40)
food_restrictions = models.CharField(max_length = 50, null = True, blank = True)
gender = models.CharField(max_length = 5, choices = genders)
def __str__(self):
return self.name
In cases where we have two professors with the same name, how do we differentiate between them? I see that in our schema we included an id field, but I am pretty sure that supposes something like a unique ID. So perhaps we should add that @amd112 ? Because even though internally we never overwrite two professors (since django automatically generates id fields since we did not declare any pks for this model), we cannot differentiate between them.