call the smart_text function with 2 arguments: return value of the obj._get_pk_val function and string_only set to boolean True,
data [ "pk" ] = smart_text ( obj . _get_pk_val ( ) , strings_only = True )