Django 外键查询

创建三张表,详情如下:
class Publish(models.Model):
    id = models.AutoField(primary_key=True, auto_created=True)
    pname = models.CharField(max_length=40)
    city = models.CharField(max_length=50)

    def __str__(self):
        return self.pname

class Author(models.Model):
    id = models.AutoField(primary_key=True, auto_created=True)
    aname 

你可能感兴趣的:(Django,django)