From 2d9e582ca23763a8dcd789ca3847c12630cc1803 Mon Sep 17 00:00:00 2001 From: Daniel Chimeno Date: Fri, 8 Aug 2014 19:10:05 +0200 Subject: [PATCH] Example of getting the model instance from factory --- tweepy/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tweepy/models.py b/tweepy/models.py index cc169ba..f728b5f 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -248,8 +248,10 @@ class SearchResults(ResultSet): results.count = metadata.get('count') results.next_results = metadata.get('next_results') + status_model = getattr(api.parser.model_factory, 'status') if api else Status + for status in json['statuses']: - results.append(Status.parse(api, status)) + results.append(status_model.parse(api, status)) return results -- 2.25.1