models.py 438 字节
Newer Older
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
1 2 3 4
from django.db import models


class Goods(models.Model):
5
    """商品模型类"""
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
6 7 8 9 10

    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')
11
    
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
12
    class Meta:
13

骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
14
        db_table = 'tb_goods'
15
        ordering = ('id', )