K
K
Klaus Kater2016-06-18 13:12:25
Django
Klaus Kater, 2016-06-18 13:12:25

How to sync base for modeltranslation in django 1.9?

Hello, there was a problem with the multilingual site.
Some time ago I already used the modeltranslation module, and then everything went without any complaints.
Now apparently problems with versions.
The documentation for modeltranslation says to use syncdb to synchronize the database, as far as I know, the system is already outdated (south), and migrations are now used.
But the migrations do not notice the modeltranslation changes, and accordingly the
Unknown field(s) (text_en_us, text_en_ru) error occurs in the admin panel.
Attempts to call the modeltranslation commands did not lead to anything.
Help convince Django.

class ContentArt(Content):
    class Meta:
        proxy = True
        verbose_name = "Статья"
        verbose_name_plural = "Статьи"
    objects = ContentArtManager()

class ContentArtTranslationOptions(TranslationOptions):
    fields = ('short_description', 'text',)
translator.register(ContentArt, ContentArtTranslationOptions)

@admin.register(ContentArt)
class ContentAdmin(TabbedTranslationAdmin):
    fieldsets = [
        ('Описание', {'fields': ['title', 'short_description', 'text', 'order', 'publicate']}),
    ]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question