在我的數據庫中,我有一個Photo類,我用作其他類的外鍵。這是兩個例子。 class SubstancePointsLabel(ResultBase):
#: photo being labeled
photo = models.ForeignKey(Photo, related_name='substance_points_labels')
class Substance
我有這個model.py: class Topping(models.Model):
name = models.CharField(max_length=32)
def __str__(self):
return self.name
class Base(models.Model):
name = models.CharField(max_leng