from django.db import models

# Create your models here.


class BookInfo(models.Model):
    btitle = models.CharField(max_length=20)#图书名称
    bpub_date = models.DateField()#发布日期
    bread = models.IntegerField(default=0)#阅读量
    bcomment = models.IntegerField(default=0)#评论量
    isDelete = models.BooleanField(default=False)#逻辑删除

    def show(self):
        return '老王'

    def __str__(self):
        return self.btitle

    class Meta:
        ordering = ['-bpub_date']#排序
        verbose_name='书籍'  #单数
        verbose_name_plural=verbose_name #复数


class HeroInfo(models.Model):
    hname = models.CharField(max_length=20)#英雄姓名
    hgender = models.BooleanField(default=True)#英雄性别
    isDelete = models.BooleanField(default=False)#逻辑删除
    hcomment = models.CharField(max_length=200)#英雄描述信息
    hbook = models.ForeignKey('BookInfo')

    def __str__(self):
        return self.hname
28f54210b5c8f45be06576be7efc8c6bd16ad68b
<mask token>


class BookInfo(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def show(self):
        return '老王'
    <mask token>


    class Meta:
        ordering = ['-bpub_date']
        verbose_name = '书籍'
        verbose_name_plural = verbose_name


class HeroInfo(models.Model):
    hname = models.CharField(max_length=20)
    hgender = models.BooleanField(default=True)
    isDelete = models.BooleanField(default=False)
    hcomment = models.CharField(max_length=200)
    hbook = models.ForeignKey('BookInfo')

    def __str__(self):
        return self.hname

<mask token>


class BookInfo(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def show(self):
        return '老王'

    def __str__(self):
        return self.btitle


    class Meta:
        ordering = ['-bpub_date']
        verbose_name = '书籍'
        verbose_name_plural = verbose_name


class HeroInfo(models.Model):
    hname = models.CharField(max_length=20)
    hgender = models.BooleanField(default=True)
    isDelete = models.BooleanField(default=False)
    hcomment = models.CharField(max_length=200)
    hbook = models.ForeignKey('BookInfo')

    def __str__(self):
        return self.hname

<mask token>


class BookInfo(models.Model):
    btitle = models.CharField(max_length=20)
    bpub_date = models.DateField()
    bread = models.IntegerField(default=0)
    bcomment = models.IntegerField(default=0)
    isDelete = models.BooleanField(default=False)

    def show(self):
        return '老王'

    def __str__(self):
        return self.btitle


    class Meta:
        ordering = ['-bpub_date']
        verbose_name = '书籍'
        verbose_name_plural = verbose_name


class HeroInfo(models.Model):
    hname = models.CharField(max_length=20)
    hgender = models.BooleanField(default=True)
    isDelete = models.BooleanField(default=False)
    hcomment = models.CharField(max_length=200)
    hbook = models.ForeignKey('BookInfo')

    def __str__(self):
        return self.hname

from django.db import models


class BookInfo(models.Model):
    btitle = models.CharField(max_length=20)
    bpub_date = models.DateField()
    bread = models.IntegerField(default=0)
    bcomment = models.IntegerField(default=0)
    isDelete = models.BooleanField(default=False)

    def show(self):
        return '老王'

    def __str__(self):
        return self.btitle


    class Meta:
        ordering = ['-bpub_date']
        verbose_name = '书籍'
        verbose_name_plural = verbose_name


class HeroInfo(models.Model):
    hname = models.CharField(max_length=20)
    hgender = models.BooleanField(default=True)
    isDelete = models.BooleanField(default=False)
    hcomment = models.CharField(max_length=200)
    hbook = models.ForeignKey('BookInfo')

    def __str__(self):
        return self.hname

from django.db import models

# Create your models here.


class BookInfo(models.Model):
    btitle = models.CharField(max_length=20)#图书名称
    bpub_date = models.DateField()#发布日期
    bread = models.IntegerField(default=0)#阅读量
    bcomment = models.IntegerField(default=0)#评论量
    isDelete = models.BooleanField(default=False)#逻辑删除

    def show(self):
        return '老王'

    def __str__(self):
        return self.btitle

    class Meta:
        ordering = ['-bpub_date']#排序
        verbose_name='书籍'  #单数
        verbose_name_plural=verbose_name #复数


class HeroInfo(models.Model):
    hname = models.CharField(max_length=20)#英雄姓名
    hgender = models.BooleanField(default=True)#英雄性别
    isDelete = models.BooleanField(default=False)#逻辑删除
    hcomment = models.CharField(max_length=200)#英雄描述信息
    hbook = models.ForeignKey('BookInfo')

    def __str__(self):
        return self.hname