列 clean_name 不存在(Wagtail 2.10)

Column clean_name does not exist (Wagtail 2.10)

我刚刚从 Wagtail 2.9.3 升级到 2.10,发现我的 FormPages 由于缺少 clean_name 字段而不再工作。我阅读了有关此新更改的文档,但完全不知道如何修复它。

升级后,我尝试 运行 连接我的本地服务器,但被告知我需要 运行 迁移,我确实这样做了。如何将 clean_name 列添加到我的字段中?我是否只是将列添加到下面的 FormField class 中,就像我通常那样?

下面是堆栈跟踪和相关模型。

ProgrammingError at /support-us/volunteer/
column core_formfield.clean_name does not exist
LINE 1: ...e_formfield"."id", "core_formfield"."sort_order", "core_form...
class FormField(AbstractFormField):
    page = ParentalKey(
        'FormPage',
        on_delete=models.CASCADE,
        related_name='form_fields',
    )

class FormPage(MetadataPageMixin, AbstractEmailForm):

    body = StreamField(BaseStreamBlock())
    confirmation_text = RichTextField(blank=True)

    content_panels = AbstractEmailForm.content_panels + [
        StreamFieldPanel('body'),
        InlinePanel('form_fields', label='Form Fields'),
        FieldPanel('confirmation_text'),
        MultiFieldPanel([
            FieldRowPanel([
                FieldPanel('from_address', classname="col6"),
                FieldPanel('to_address', classname="col6"),
            ]),
            FieldPanel("subject"),
        ], heading="Email Settings"),
    ]

    class Meta:
        verbose_name = 'Form Page'
        verbose_name_plural = 'Form Pages'

运行 ./manage.py makemigrations./manage.py migrate 升级后应该足够了。无需更改您的代码 - 新的 clean_name 字段被定义为 AbstractFormField 的一部分,因此无需将其添加到您自己的 Formfield 定义中。