我在管理中的表格内联如下所示:
我如何摆脱DateDeCotisation_adherents object
短语?在
对于加分,为什么底部有三条空线?在
管理员py在
class DatesDeCotisationInline(admin.TabularInline):
model = DateDeCotisation.adherents.through
readonly_fields = ['datedecotisation']
can_delete = False
模型.py在
^{pr2}$
Tags:
内联应该从模型according to the documentation的内部}。但是,我刚刚将您的代码转储到最新的django中,它实际上没有(或者,也许,只有当您使用
Meta
类中获取verbose_name
和{.through
时它才这样做)。在幸运的是,您可以通过直接在}来覆盖它,即
InlineModelAdmin
中设置verbose_name
和{(很抱歉这里的“for”,但我不会说法语)
admin在Django 1.10中显示如下:
请注意,在Python3中,您永远不需要执行
^{pr2}$.encode('utf-8')
。默认情况下,它的刺是UTF-8。在(我假设您使用的是python3,因为您使用的是
__str__
)相关问题 更多 >
编程相关推荐