3

I have the following model:

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)
)

I have two instances of that model: "source" and "destination". When I try to copy translatable field from the source to the destination:

destination.name = source.name

An exception appears:

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

Is there anyway to handle that?

My configuration is:

django-hvad==1.7.0
Django==1.8.8
Roman Storozhenko
  • 369
  • 1
  • 3
  • 16

0 Answers0