這是我延伸它有一些其他的領域,如text
,time
另一種模式Message
一組消息模型等如何更改django表單字段的幫助文本?
class GroupMessage(Message):
group = models.ForeignKey(Group, related_name='+')
以下是我已經爲這個模型創建的形式。
class GroupForm(ModelForm):
class Meta:
model = GroupMessage
如何在我的表單中更改組字段的幫助文本?任何幫助,將不勝感激。
你的意思是標籤?這裏是類似的問題:http://stackoverflow.com/questions/14027185/django-model-forms-customizing-fields - 但它沒有正確回答! –
看到我的回答:http://stackoverflow.com/a/24345173/667154 –
我從來沒有做過..但在fields.py我看到類似'help_text' ..然後嘗試它..'help_text ='你的幫助信息''。順便說一句。你不應該使用'_'作爲類名。 '_'用於受保護的方法/變量。 –