File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ def __init__(self, **kwargs):
1717 self .param_defaults = {}
1818
1919 def __str__ (self ):
20+ """ Returns a string representation of TwitterModel. By default
21+ this is the same as AsJsonString(). """
2022 return self .AsJsonString ()
2123
2224 def __eq__ (self , other ):
@@ -26,6 +28,8 @@ def __ne__(self, other):
2628 return not self .__eq__ (other )
2729
2830 def AsJsonString (self ):
31+ """ Returns the TwitterModel as a JSON string based on key/value
32+ pairs returned from the AsDict() method. """
2933 return json .dumps (self .AsDict (), sort_keys = True )
3034
3135 def AsDict (self ):
@@ -341,7 +345,7 @@ def __repr__(self):
341345 @classmethod
342346 def NewFromJsonDict (cls , data , ** kwargs ):
343347 from twitter import Status
344- if data .get ('status' ):
348+ if data .get ('status' , None ):
345349 status = Status .NewFromJsonDict (data .get ('status' ))
346350 return super (cls , cls ).NewFromJsonDict (data = data , status = status )
347351 else :
You can’t perform that action at this time.
0 commit comments