@Quixt

Как подружить wagtail-modeltranslation?

Прошу помогите с работой wagtail-modeltranslation
Ругательства:
File "/home/vladimir/projects/python/django/ESF3/virtualenv/lib/python3.7/site-packages/django/forms/models.py", line 266, in new
raise FieldError(message)
django.core.exceptions.FieldError: Unknown field(s) (seo_title_fr, slug_fr, search_description_fr) specified for BlogIndexPage

from django.db import models

from wagtail.core.models import Page
from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.search import index


# Keep the definition of BlogIndexPage, and add:

class BlogIndexPage(Page):
    intro = RichTextField(blank=True)

    content_panels = Page.content_panels + [
        FieldPanel('intro', classname="full")
    ]
class BlogPage(Page):
    date = models.DateField("Post date")
    intro = models.CharField(max_length=250)
    body = RichTextField(blank=True)


    search_fields = Page.search_fields + [
        index.SearchField('intro'),
        index.SearchField('body'),
    ]

    content_panels = Page.content_panels + [
        FieldPanel('date'),
        FieldPanel('intro'),
        FieldPanel('body', classname="full"),
    ]


from .models import BlogPage
from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register

@register(BlogPage)
class BlogPageTR(TranslationOptions):
    fields = (
        'body',
    )
  • Вопрос задан
  • 105 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы