Python-100-Days/Day41-55/code/shop/cart/models.py

16 lines
434 B
Python
Raw Normal View History

2018-05-25 13:26:52 +08:00
from django.db import models
class Goods(models.Model):
2018-05-25 17:00:43 +08:00
"""商品模型类"""
2018-05-25 13:26:52 +08:00
id = models.AutoField(primary_key=True, db_column='gid')
name = models.CharField(max_length=50, db_column='gname')
price = models.DecimalField(max_digits=10, decimal_places=2, db_column='gprice')
image = models.CharField(max_length=255, db_column='gimage')
class Meta:
2018-05-25 17:00:43 +08:00
2018-05-25 13:26:52 +08:00
db_table = 'tb_goods'
2018-05-25 17:00:43 +08:00
ordering = ('id', )