from django.db import models

# Create your models here.
class BookModel(models.Model):

    bid = models.AutoField(primary_key=True)
    book_name = models.CharField(max_length=32)

    #外键 出版社
    pub = models.ForeignKey('PublisherModel',on_delete=models.CASCADE, db_column='pid',related_name='books',blank=True,null=True)

    class Meta:
        db_table  = 'book'

class PublisherModel(models.Model):

    pid = models.AutoField(primary_key=True)

    pname = models.CharField(max_length=32)

    class Meta:
        db_table  = 'publisher'

7889963f474b93c298d21b6f6d639587a5734f06
<mask token>


class PublisherModel(models.Model):
    pid = models.AutoField(primary_key=True)
    pname = models.CharField(max_length=32)


    class Meta:
        db_table = 'publisher'

<mask token>


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


    class Meta:
        db_table = 'book'


class PublisherModel(models.Model):
    pid = models.AutoField(primary_key=True)
    pname = models.CharField(max_length=32)


    class Meta:
        db_table = 'publisher'

<mask token>


class BookModel(models.Model):
    bid = models.AutoField(primary_key=True)
    book_name = models.CharField(max_length=32)
    pub = models.ForeignKey('PublisherModel', on_delete=models.CASCADE,
        db_column='pid', related_name='books', blank=True, null=True)


    class Meta:
        db_table = 'book'


class PublisherModel(models.Model):
    pid = models.AutoField(primary_key=True)
    pname = models.CharField(max_length=32)


    class Meta:
        db_table = 'publisher'

from django.db import models


class BookModel(models.Model):
    bid = models.AutoField(primary_key=True)
    book_name = models.CharField(max_length=32)
    pub = models.ForeignKey('PublisherModel', on_delete=models.CASCADE,
        db_column='pid', related_name='books', blank=True, null=True)


    class Meta:
        db_table = 'book'


class PublisherModel(models.Model):
    pid = models.AutoField(primary_key=True)
    pname = models.CharField(max_length=32)


    class Meta:
        db_table = 'publisher'

from django.db import models

# Create your models here.
class BookModel(models.Model):

    bid = models.AutoField(primary_key=True)
    book_name = models.CharField(max_length=32)

    #外键 出版社
    pub = models.ForeignKey('PublisherModel',on_delete=models.CASCADE, db_column='pid',related_name='books',blank=True,null=True)

    class Meta:
        db_table  = 'book'

class PublisherModel(models.Model):

    pid = models.AutoField(primary_key=True)

    pname = models.CharField(max_length=32)

    class Meta:
        db_table  = 'publisher'
