1. Django admin coercing to Unicode: need string or buffer, tuple found,如图1示

原因:__unicode__() 中return的必须是String类型的。
解决办法:方法一是返回String类型;
方法二是用return "{0}, {1}".format(self.name, self.numbers),用格式化的方式。
1. Django admin coercing to Unicode: need string or buffer, tuple found,如图1示
原因:__unicode__() 中return的必须是String类型的。
解决办法:方法一是返回String类型;
方法二是用return "{0}, {1}".format(self.name, self.numbers),用格式化的方式。
本文标题:Django 报错汇总
本文链接:https://www.haomeiwen.com/subject/seefiftx.html
网友评论