django使用小结
- 生成某个app的数据库信息
./manage.py makemigrations myapp
- 外键
tag = models.ForeignKey(Tag, related_name = 'fk_tag')
- django管理后台显示object解决方法
针对python2.7, models需要定义,unicode(self); 针对python3,需要定义,str(self)
本文共 250 字,大约阅读时间需要 1 分钟。
./manage.py makemigrations myapp
tag = models.ForeignKey(Tag, related_name = 'fk_tag')
针对python2.7, models需要定义,unicode(self); 针对python3,需要定义,str(self)
转载于:https://my.oschina.net/u/2351685/blog/617887