0
我正在爲網上商店製作購物車。我有一個像什麼是產品屬性的好模型
#Product
from django.db import models
class Product(models.Model):
title = models.CharField()
attribute = models.ManyToManyField('Attribute')
我怎樣才能讓屬性模型,如大小,顏色與它們的鍵,如數字或選擇一個型號產品(「紅」,「綠」,......)?