I develop an application using Flask. I use Postgres db (psycop2), SQLAlchemy and Flask-Admin for admin interface. And I got a problem and can't find a solution. I have many-to-many relationship between articles and tags tables it's clear. In the Flask-Admin interface when I try to add a tag to articel (or vise versa) it works fine. But it displays awfully and it impossible to choose correct tag because it displays like an object:
这是正确的,因为它是我的模型类的一个实例。但是我如何才能在此处仅显示该模型中单个字段的值呢?我真的不知道该怎么做。管理界面中是否有此类“表单字段”的参数?我什么也找不到。我希望有人知道解决方案。
感谢您的帮助!
为像我这样偶然发现这个答案的人添加这个,它对我不起作用,但是
def __str__(self):
return self.name
工作得很好;)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)