示例#1
0
 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']
示例#2
0
 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']
示例#3
0
 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']
示例#4
0
 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']
示例#5
0
 class Meta:
     queryset = Playlist.objects.all()
     allowed_methods = ['get', 'post', 'put', 'delete']
     authentication = MultiAuthentication(BasicAuthentication(realm="Open Sound Stream: PlaylistResource"),
                                          ApiKeyOnlyAuthentication())
     authorization = UserObjectsOnlyAuthorization()