Reputation: 1254
Is there any way to dump and load data with a TranslatableModel
because with the common python manage.py dumpdata app.Organization -o fixtures/organizations.json
Django command translated fields do not appear in the file.
models.py:
class Organization(TranslatableModel, Entity):
translations = TranslatedFields(
name = models.CharField(verbose_name=_("Name"), max_length=200),
description = RichTextField(verbose_name=_("Description"), blank=True, null=True, config_name='default')
)
status = models.CharField(verbose_name=_("Status"), max_length=50),
organizations.json:
[
{
"model": "app.organization",
"pk": 1,
"fields": {
"status": "Active"
}
},
{
"model": "app.organization",
"pk": 2,
"fields": {
"status": "Active",
}
}
]
Any ideas?
Upvotes: 3
Views: 162
Reputation: 106
as the translations are stored in an own model/table you will need to call
python manage.py dumpdata app.OrganizationTranslation -o fixtures/organization_tranlsations.json
Upvotes: 0