コード例 #1
0
 class Meta:
     queryset = MakerSciencePost.objects.all()
     allowed_methods = ['get']
     resource_name = 'makerscience/postlight'
     authentication = AnonymousApiKeyAuthentication()
     authorization = MakerSciencePostAuthorization()
     always_return_data = True
     filtering = {
         'post_type': ['exact'],
         'parent_id': ['exact'],
         'id': ['exact'],
     }
コード例 #2
0
 class Meta:
     queryset = Notification.objects.all()
     allowed_methods = ['get', 'patch']
     resource_name = 'notification'
     always_return_data = True
     authentication = AnonymousApiKeyAuthentication()
     authorization = DjangoAuthorization()
     limit = 0
     excludes = ['data', 'emailed', 'public']
     filtering = {'recipient_id': ['exact']}
     ordering = [
         '-timestamp',
     ]
コード例 #3
0
 class Meta:
     queryset = MakerScienceResourceTaggedItem.objects.all()
     resource_name = 'makerscience/resourcetaggeditem'
     default_format = "application/json"
     authentication = AnonymousApiKeyAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "tag" : ALL_WITH_RELATIONS,
         "object_id" : ['exact', ],
         'tag_type' : ['exact', ]
     }
     always_return_data = True
     limit = 0
コード例 #4
0
 class Meta:
     queryset = MakerSciencePost.objects.all()
     allowed_methods = ['get', 'post']
     resource_name = 'makerscience/post'
     authentication = AnonymousApiKeyAuthentication()
     authorization = MakerSciencePostAuthorization()
     always_return_data = True
     filtering = {
         'parent': ALL_WITH_RELATIONS,
         'post_type': ['exact'],
         'linked_projects': ['isnull']
     }
     limit = 7
コード例 #5
0
 class Meta:
     object_class = MakerScienceResource
     object_profile_link_level = 10
     queryset = MakerScienceResource.objects.all()
     allowed_methods = ['get', 'post', 'put', 'patch']
     resource_name = 'makerscience/resource'
     authentication = AnonymousApiKeyAuthentication()
     authorization = MakerScienceResourceAuthorization()
     always_return_data = True
     filtering = {
         'parent' : ALL_WITH_RELATIONS,
         'featured' : ['exact'],
     }
     limit = 6
コード例 #6
0
 class Meta:
     queryset = MakerScienceProfile.objects.all()
     allowed_methods = ['get']
     resource_name = 'makerscience/profilelight'
     authentication = AnonymousApiKeyAuthentication()
     authorization = DjangoAuthorization()
     always_return_data = True
     detail_uri_name = 'slug'
     excludes = ["bio", "facebook", "linkedin", "twitter", "website"]
     filtering = {
         'id': [
             'exact',
         ],
         'parent_id': [
             'exact',
         ],
         'slug': [
             'exact',
         ]
     }
     limit = 6
コード例 #7
0
 class Meta:
     queryset = MakerScienceProfile.objects.all()
     allowed_methods = ['get', 'post', 'put', 'patch', 'delete']
     resource_name = 'makerscience/profile'
     authentication = AnonymousApiKeyAuthentication()
     authorization = MakerScienceProfileAuthorization()
     always_return_data = True
     detail_uri_name = 'slug'
     filtering = {
         'parent': ALL_WITH_RELATIONS,
         "location": [
             'isnull',
         ],
         'id': [
             'exact',
         ],
         'slug': [
             'exact',
         ]
     }
     limit = 6