class Meta: queryset = ApiKey.objects.all() allowed_methods = ['get', 'post', 'delete'] always_return_data = True authentication = BasicAuthentication(realm="Open Sound Stream: ApiKeyResource") authorization = UserObjectsOnlyAuthorization() excludes = ['key', 'shown']
class Meta: queryset = Artist.objects.filter() allowed_methods = ['get', 'post', 'put', 'delete'] authentication = MultiAuthentication( BasicAuthentication(realm="Open Sound Stream: ArtistResource"), ApiKeyOnlyAuthentication()) authorization = UserObjectsOnlyAuthorization() always_return_data = True excludes = ['user']
class Meta: resource_name = 'song' queryset = Track.objects.all() allowed_methods = ['get', 'post', 'put', 'delete'] authentication = MultiAuthentication( BasicAuthentication(realm="Open Sound Stream: SongResource"), ApiKeyOnlyAuthentication()) authorization = UserObjectsOnlyAuthorization() always_return_data = True excludes = ['user']
class Meta: queryset = ApiKey.objects.all() allowed_methods = ['get', 'post', 'delete'] always_return_data = True authentication = MultiAuthentication( RestrictToMethod(ApiKeyOnlyAuthentication(), method='DELETE'), RestrictToMethod( BasicAuthentication(realm="Open Sound Stream: ApiKeyResource"), method=["GET", "POST"])) authorization = UserObjectsOnlyAuthorization() excludes = ['key', 'shown', 'user']
class Meta: queryset = Playlist.objects.all() allowed_methods = ['get', 'post', 'put', 'delete'] authentication = MultiAuthentication(BasicAuthentication(realm="Open Sound Stream: PlaylistResource"), ApiKeyOnlyAuthentication()) authorization = UserObjectsOnlyAuthorization()