Django很有价值

时间:2017-12-02 15:17:31

标签: python django field

来源示例:

class Amenities(models.Model):
    title = models.CharField("Title", max_length=300)
    value = models.BooleanField("Bool",default=False)

    class Meta:
        db_table = "amenities"

    def __str__(self):
        return self.title

class Property(models.Model):     
    title = models.CharField("Name category", max_length=300)
    amenities = models.ManyToManyField(Amenities)

我想创建一个列表Aminities。 Merge Amenities表与Rent表和每行添加一个值。

喜欢图片

enter image description here

1 个答案:

答案 0 :(得分:0)