Commit d8f598cb authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Added follow/unfollow shortcuts to User model. Fixed issue with User.following...

Added follow/unfollow shortcuts to User model. Fixed issue with User.following being set to None when user not followed.
parent 8b0d0c59
......@@ -2,5 +2,11 @@ All changes made to the library that might affect applications
during upgrade will be listed here.
1.0 -> 1.0.1
Status.user -->
+ Status.user -->
+ User:
+ follow()
+ unfollow()
+ Fixes
+ User.following is now set to False instead of None
when user is not followed.
......@@ -9,4 +9,5 @@ The plan of attack for the next version of Tweepy.
+ rate limit governor
+ prepare for social graph changes mentioned on mailinglist
+ finish search api
+ autodetect authenticated user's ID
......@@ -68,6 +68,13 @@ class User(Model):
def followers(self, **kargs):
return self._api.followers(, **kargs)
def follow(self):
self.following = True
def unfollow(self):
self.following = False
class DirectMessage(Model):
def destroy(self):
......@@ -52,6 +52,12 @@ def _parse_user(obj, api):
setattr(user, k, _parse_datetime(v))
elif k == 'status':
setattr(user, k, _parse_status(v, api))
elif k == 'following':
# twitter sets this to null if it is false
if v is True:
setattr(user, k, True)
setattr(user, k, False)
setattr(user, k, v)
return user
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment