コード例 #1
0
ファイル: _api.py プロジェクト: AnneGilles/soundcloudapi
 def _shared_to(self, context, data, delete, replace):
     key = context == 'email' and 'address' or 'id'
     params = MultiDict()
     for value in data:
         params.add('%s[][%s]' % (context, key), value)
     return self._subresource_dispatcher('shared-to/%s' % context,
                                         scid=scid,
                                         delete=delete,
                                         postdata=replace and params
                                         or None,
                                         putdata=not replace and params
                                         or None,
                                         allowed_methods=[
                                             'GET',
                                             'DELETE',
                                             'PUT',
                                             'POST',
                                         ])