from django.db import models

# Create your models here.
class Book(models.Model):
    title = models.CharField('书名',max_length=50,default='')
    price = models.DecimalField('定价',max_digits=7,decimal_places=2,default=0.0)
    market_price = models.DecimalField('零售价',max_digits=7,decimal_places=2,default=0.0)
    pub = models.CharField('出版社',max_length=50,default='')
    def __str__(self):
        return "书名：%s，出版社：%s，价格：%s，零售价：%s"%(self.title,self.pub,self.price,self.market_price)
    class Meta:
        # verbose_name = '图书'
        verbose_name_plural = '图书'