我希望我错了,但在我看来,要想使一个many域没有help_text
的唯一方法是为表单编写一个__init__
方法,然后重写self.fields[fieldname].help_text
。这真的是唯一的办法吗?我更喜欢使用CheckboxSelectMultple
小部件,那么我真的要为任何使用ManyToManyField
的表单定义__init__
方法吗?在
class ManyToManyField(RelatedField, Field):
description = _("Many-to-many relationship")
def __init__(self, to, **kwargs):
#some other stuff
msg = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
self.help_text = string_concat(self.help_text, ' ', msg)
你没有错。我自己也遇到了这个问题,为了避开这个问题,我创建了自己的ManyToManyField。在
下面是我评论的一个相关错误:http://code.djangoproject.com/ticket/6183
以常规形式:
如果要更改(i18n)字符串:
^{pr2}$用django 1.6测试
相关问题 更多 >
编程相关推荐