def __set__(self, instance, value):
        """
        Updates the translation field for the current language.
        """
        # In order for deferred fields to work, we also need to set the base value
        instance.__dict__[self.field.name] = value
        if isinstance(self.field, fields.related.ForeignKey):
            instance.__dict__[self.field.get_attname()] = None if value is None else value.pk
        if getattr(instance, '_mt_init', False):
            # When assignment takes place in model instance constructor, don't set value.
            # This is essential for only/defer to work, but I think it's sensible anyway.
            return
        loc_field_name = build_localized_fieldname(self.field.name, get_language())
        setattr(instance, loc_field_name, value)
def __set__ ( self , instance , value ) : instance . __dict__ [ self . field . name ] = value if isinstance ( self . field , fields . related . ForeignKey ) : instance . __dict__ [ self . field . get_attname ( ) ] = None if value is None else value . pk if getattr ( instance , '_mt_init' , False ) : return loc_field_name = build_localized_fieldname ( self . field . name , get_language ( ) ) setattr ( instance , loc_field_name , value )
Updates the translation field for the current language.