一. 多表操作 数据库表关系之关联字段与外键约束 一对多 book(多) publish(一) 查询<<水浒传>>这本书出版社的地址: select publish_id from Book where title="水浒传" select addr from Publish where id=1 一旦确定了一对多的关系: 建立一对多的关系,在多的一方建立关联字段(publish_id) 多对多: book author book2author: panshao
实验楼表关系图 from utils.MyBaseModel import Base from django.db import models # # Create your models here. # 课程类别 class CourseType(Base): title = models.CharField('课程类别', max_length=32) sequence = models.IntegerField('顺序显示', default=10) class Meta: db_tabl