简体   繁体   English

来自 python 速成班 web 应用程序 django 项目

[英]from python crash course web app django project

[enter image description here][1] [在此处输入图片描述][1]

I am trying to do the web app project and attempting to print topic ids but it prints only Object(number) and I am pretty sure it has to do something with django admin [1]: https://i.stack.imgur.com/1WkEr.png我正在尝试做 web 应用程序项目并尝试打印主题 ID,但它只打印对象(数字),我很确定它必须与 django admin [1]: https://i.stack.imgur 做一些事情。 com/1WkEr.png

You need to indent your __str__ function so that it belongs to the class. So it has to get 4 spaces or 1 tab.您需要缩进__str__ function 以便它属于 class。所以它必须有 4 个空格或 1 个制表符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM