Python-100-Days/Day41-55/shop_origin/cart/models.py

14 lines
406 B
Python
Raw Normal View History

2018-05-25 17:00:43 +08:00
from django.db import models
class Goods(models.Model):
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:
db_table = 'tb_goods'
ordering = ('id',)