Beispiel #1
0
 class Meta:
     queryset = Preview.objects.all()
     list_allowed_methods = ['post']
     allowed_methods = ['get', 'delete']
     always_return_data = True
     fields = ['id', 'filetype']
     authentication = MarketplaceAuthentication()
     authorization = OwnerAuthorization()
     resource_name = 'preview'
     filtering = {'addon': ALL_WITH_RELATIONS}
Beispiel #2
0
 class Meta:
     queryset = Addon.objects.filter(type=amo.ADDON_WEBAPP)
     fields = ['status', 'disabled_by_user']
     list_allowed_methods = []
     allowed_methods = ['patch', 'get']
     always_return_data = True
     authentication = MarketplaceAuthentication()
     authorization = AppOwnerAuthorization()
     resource_name = 'status'
     serializer = Serializer(formats=['json'])
Beispiel #3
0
 class Meta:
     queryset = FileUpload.objects.all()
     fields = ['valid', 'validation']
     list_allowed_methods = ['post']
     allowed_methods = ['get']
     always_return_data = True
     authentication = MarketplaceAuthentication()
     # This will return that anyone can do anything because objects
     # don't always get passed the authorization handler.
     authorization = OwnerAuthorization()
     resource_name = 'validation'
     serializer = Serializer(formats=['json'])
Beispiel #4
0
 class Meta:
     queryset = Addon.objects.filter(type=amo.ADDON_WEBAPP)
     fields = ['id', 'name', 'description', 'device_types',
               'homepage', 'privacy_policy',
               'status', 'summary', 'support_email', 'support_url',
               'categories']
     list_allowed_methods = ['post']
     allowed_methods = ['get', 'put']
     always_return_data = True
     authentication = MarketplaceAuthentication()
     authorization = AppOwnerAuthorization()
     resource_name = 'app'
     serializer = Serializer(formats=['json'])