from django.db import models

# Create your models here.
class BookInfo(models.Model):
    # 创建一个图书模型类
    bname = models.CharField(max_length=20)
    bpub_date = models.DateField()
    bread = models.IntegerField(default=0)
    bcomment = models.IntegerField(default=0)
    is_delete = models.BooleanField(default=False)

    def __str__(self):
        # 定义对象显示的内容
        return self.bname

    class Meta:
        # 定义此模型类指向的数据表名
        db_table = 'models_bookinfo'
