Skip to content

Commit a035380

Browse files
author
Mike Kistler
committed
Add _convert_model method
1 parent bdd1eb3 commit a035380

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

watson_developer_cloud/watson_service.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ def unpack_id(dictionary, label_id):
182182
return dictionary[label_id]
183183
return dictionary
184184

185+
@staticmethod
186+
def _convert_model(val):
187+
if hasattr(val, "_to_dict"):
188+
return val._to_dict()
189+
return val
190+
185191
@staticmethod
186192
def _get_error_message(response):
187193
"""

0 commit comments

Comments
 (0)