Wigtail中FieldPanel的自定义标签

时间:2017-02-22 10:02:06

标签: wagtail

有没有办法在Wagtail中将自定义标签设置为FieldPanel?我想做点什么:

class BlogPage(Page):
    intro = models.CharField(max_length=255)

    panels = [
        FieldPanel('intro', label = "My custom label")
    ]

1 个答案:

答案 0 :(得分:7)

模型字段接受verbose_name属性,该属性将被选取用作表单字段标签:

class BlogPage(Page):
    intro = models.CharField(max_length=255, verbose_name="My custom label")

    panels = [
        FieldPanel('intro')
    ]