自定义管理界面:
admin用法:
首先创建admin
模型类添加到admin.py里面
创建页面管理类
启动server后再地址后面加上/admin
关联:
类的关联
code:
现象:
如果不习惯StackedInline这种方式,可以改为下面:
改为 TabularInline
只需要该上面的code的那一行:
关联总结:
图书和英雄是一对多是关系
这样再添加图书的时候可以添几个对象进去