Improvements to Relationship Model and documentation for API.lookup_friendships
authorLuis Tejero <luis@Luiss-MacBook-Pro.local>
Tue, 26 May 2020 20:10:01 +0000 (21:10 +0100)
committerLuis Tejero <luis@Luiss-MacBook-Pro.local>
Tue, 26 May 2020 20:10:01 +0000 (21:10 +0100)
docs/api.rst
tweepy/models.py

index 3c43335c4afe4609ef91df694fd2217866e27785..7590875ad463a1dafc7d71304311302a59a52c90 100644 (file)
@@ -468,6 +468,18 @@ Friendship Methods
    :rtype: :class:`Friendship` object
 
 
+.. method:: API.lookup_friendships([user_ids], [screen_names])
+
+   Returns the relationships of the authenticated user to the list of up to
+   100 screen_names or user_ids provided.
+
+   :param user_ids: A list of user IDs, up to 100 are allowed in a single
+                    request.
+   :param screen_names: A list of screen names, up to 100 are allowed in a
+                        single request.
+   :rtype: :class:`Relationship` object
+
+
 .. method:: API.friends_ids(id/screen_name/user_id, [cursor])
 
    Returns an array containing the IDs of users being followed by the specified
index 03620678e933626fae0f79b794ce1f01afa894c3..cbb5b9c00f690a76e0f4b58f815628a13f624ba9 100644 (file)
@@ -399,6 +399,10 @@ class Relationship(Model):
             if k == 'connections':
                 setattr(result, 'is_following', 'following' in v)
                 setattr(result, 'is_followed_by', 'followed_by' in v)
+                setattr(result, 'is_muted', 'muting' in v)
+                setattr(result, 'is_blocked', 'blocking' in v)
+                setattr(result, 'is_following_requested', 'following_requested' in v)
+                setattr(result, 'no_relationship', 'none' in v)
             else:
                 setattr(result, k, v)
         return result