我有以下型号:
class AModel(TranslatableModel):
......
other fields definitions
......
translations = TranslatedFields(
name=models.CharField(max_length=100, blank=False, default=''),
description=models.CharField(max_length=500, blank=True, null=True)
)
我有两个该模型的实例:" source"和"目的地"。当我尝试将可翻译字段从源复制到目标时:
destination.name = source.name
出现异常:
NoTranslationError: Accessing a translated field requires that the instance has a translation loaded, or a valid translation in current language (en-us) loadable from the database
无论如何要处理它?</ p>
我的配置是:
django-hvad==1.7.0
Django==1.8.8