Add _json field to user and status models, including entire twitter json object
authorJonathan Ronen <yablee@gmail.com>
Fri, 4 Apr 2014 22:10:59 +0000 (18:10 -0400)
committerJonathan Ronen <yablee@gmail.com>
Fri, 4 Apr 2014 22:10:59 +0000 (18:10 -0400)
tweepy/models.py

index 1338ab456b37227d895f2128af9942e79417edd0..263b8b402fb14f59cd7159f9302f1eb1ed97fa6d 100644 (file)
@@ -68,6 +68,7 @@ class Status(Model):
     @classmethod
     def parse(cls, api, json):
         status = cls(api)
+        setattr(status, '_json', json)
         for k, v in json.items():
             if k == 'user':
                 user_model = getattr(api.parser.model_factory, 'user') if api else User
@@ -112,6 +113,7 @@ class User(Model):
     @classmethod
     def parse(cls, api, json):
         user = cls(api)
+        setattr(user, '_json', json)
         for k, v in json.items():
             if k == 'created_at':
                 setattr(user, k, parse_datetime(v))