0
間接的關係,我有三個型號Django的關係如何映射模型
class Venue(models.Model):
property_values = models.ManyToManyField('feature.PropertyValue')
class Feature(models.Model):
name = models.CharField(max_length=255, null=False, blank=False)
class PropertyValue(models.Model):
name = models.CharField(max_length=255, null=False, blank=False)
feature = models.ForeignKey('Feature', null=False, blank=False)
在此我希望能夠在通過屬性值屬於它的場地模型俗話說配置「功能」。
像
class Venue(models.Model):
property_values = models.ManyToManyField('feature.PropertyValue')
feature = models.ManyToManyField(via property_value something)