Django: “Can't convert 'Name' object to str implicitly” on saving object

前端 未结 2 1812
北海茫月
北海茫月 2021-01-28 01:58

In Django admin, I have created a Name object with name: \"United Kingdom\". I then create a Nation object with the Name object I\'ve just created, and a path to a flag image. <

2条回答
  •  时光说笑
    2021-01-28 02:35

    The change that fixed the problem:

    'Name: ' + self.name.name

    That way I'm correctly referring to the name column in the name table.

提交回复
热议问题