==创建goods应用,安装==
==定义模型类==
## 商品类别表:
# cate_name varchar(20)
class Category(models.Model):
cate_name = models.CharField(max_length=20,verbose_name='类别名字')
class Meta:
db_table='category'
verbose_name_plural="商品类别"
def __str__(self):
return self.cate_name
class Goods(models.Model):
# 商品名字
sku_name = models.CharField(max_length=100,verbose_name='商品名字')
price = models.DecimalField(max_digits=13,decimal_places=2,verbose_name="商品价格")
selling_price = models.DecimalField(max_digits=13,decimal_places=2,verbose_name="商品销售价格")
img = models.CharField(max_length=200,verbose_name="商品默认图片")
title = models.CharField(max_length=30,verbose_name="商品标题",null=True)
instruction = models.TextField(