===========================
+ Models
- Added some new helper methods to List model
+ - User model
+ - Added lists_memberships, lists_subscriptions, and lists helpers
++ API
+ - lists(), lists_memberships(), and lists_subscriptions() now
+ take an "user" parameter for specifying which user to query.
1.3 -> 1.4 [current]
===========================
require_auth = True
)(self, *args, **kargs)
- def lists(self, *args, **kargs):
- return bind_api(
- path = '/%s/lists.json' % self.auth.get_username(),
- parser = parse_lists,
- allowed_param = ['cursor'],
- require_auth = True
- )(self, *args, **kargs)
- lists.pagination_mode = 'cursor'
+ lists = bind_api(
+ path = '/{user}/lists.json',
+ parser = parse_lists,
+ allowed_param = ['user', 'cursor'],
+ require_auth = True
+ )
- def lists_memberships(self, *args, **kargs):
- return bind_api(
- path = '/%s/lists/memberships.json' % self.auth.get_username(),
- parser = parse_lists,
- allowed_param = ['cursor'],
- require_auth = True
- )(self, *args, **kargs)
- lists_memberships.pagination_mode = 'cursor'
+ lists_memberships = bind_api(
+ path = '/{user}/lists/memberships.json',
+ parser = parse_lists,
+ allowed_param = ['user', 'cursor'],
+ require_auth = True
+ )
- def lists_subscriptions(self, *args, **kargs):
- return bind_api(
- path = '/%s/lists/subscriptions.json' % self.auth.get_username(),
- parser = parse_lists,
- allowed_param = ['cursor'],
- require_auth = True
- )(self, *args, **kargs)
- lists_subscriptions.pagination_mode = 'cursor'
+ lists_subscriptions = bind_api(
+ path = '/{user}/lists/subscriptions.json',
+ parser = parse_lists,
+ allowed_param = ['user', 'cursor'],
+ require_auth = True
+ )
list_timeline = bind_api(
path = '/{owner}/lists/{slug}/statuses.json',
self._api.destroy_friendship(user_id=self.id)
self.following = False
+ def lists_memberships(self):
+ return self._api.lists_memberships(user=self.screen_name)
+
+ def lists_subscriptions(self):
+ return self._api.lists_subscriptions(user=self.screen_name)
+
+ def lists(self):
+ return self._api.lists(user=self.screen_name)
+
class DirectMessage(Model):