如何将现有模型迁移到Wagtail Page模型

时间:2019-11-20 23:39:18

标签: django django-models wagtail

我有一个现有的模型,EmsanWorks(models.Model)。 我想要一个相同的页面模型,因此我复制了一个新模型并将其命名为EmsanWorksPage,并将models.Model更改为Page

    class EmsanWorksPage(Page):
        id_works = models.AutoField(primary_key=True)
        name_r = models.CharField(max_length=255)
        name_o = models.CharField(max_length=255)
        title_r = models.TextField()
        title_o = models.TextField()
        title_t = models.TextField()
        birth_y = models.CharField(max_length=20)
        birth_c = models.ForeignKey(EmsanPays, models.DO_NOTHING, db_column='birth_c',related_name='page_emsanpays_birth_c')
        gender = models.CharField(max_length=6)
        dest = models.CharField(max_length=255)
        media_spec = models.CharField(max_length=255)
        year = models.TextField()  # This field type is a guess.
        commission = models.CharField(max_length=255)
        performer = models.CharField(max_length=255)
        first_perf = models.CharField(max_length=255)
        duration = models.CharField(max_length=255)
        perf_c = models.ForeignKey(EmsanPays, models.DO_NOTHING, db_column='perf_c')
        context = models.TextField()
        instr = models.TextField()
        cycle = models.CharField(max_length=255)
        media_w = models.CharField(max_length=255)
        setup = models.CharField(max_length=255)
        prod_loc = models.TextField()
        prod_per = models.TextField()
        perf_tech = models.TextField()
        perf_media = models.TextField()
        publisher = models.CharField(max_length=255)
        audio = models.CharField(max_length=255)
        prog_notes = models.TextField()
        reception = models.TextField()
        editor = models.CharField(max_length=255)
        phono = models.CharField(max_length=255)
        comment = models.TextField()
        timestamp = models.DateTimeField()
        modif = models.TextField()
        afficher = models.CharField(max_length=3)
        restricted_editors = models.TextField()

        class Meta:
            managed = False
            db_table = 'emsan_works'

但是,在迁移之后,我收到了此错误

  

OperationalError,位于/ admin / emsanapp / emsanworkspage /   (1054,““字段列表”中的未知列“ emsan_works.page_ptr_id””)

0 个答案:

没有答案