code: def get_value_for_datastore(self, model_instance):
          
          table_id = getattr(model_instance, self.table_fieldname, None)
          object_id = getattr(model_instance, self.object_fieldname, None)
          return table_id, object_id
docs: Get key of reference rather than reference itself.