coercing to Unicode: need string or buffer, NoneType found when rendering in django admin

后端 未结 6 631
梦毁少年i
梦毁少年i 2020-12-07 22:32

I have this error since a long time but can\'t figure it out :

Caught TypeError while rendering: coercing to Unicode: need string or buffer, NoneType found

6条回答
  •  一生所求
    2020-12-07 22:57

    The return value def __unicode __ should be similar to the return value of the related models (tables) for correct viewing of "some_field" in django admin panel. You can also use:

    def __str__(self):
        return self.some_field
    

提交回复
热议问题