예제 #1
0
 class Meta:
     queryset = GroupCategory.objects.all()
     allowed_methods = ['get']
     include_resource_uri = False
     filtering = {'slug': ALL, 'name': ALL}
     ordering = ['name']
     authorization = ApiLockdownAuthorization()
예제 #2
0
 class Meta:
     queryset = TopicCategory.objects.all()
     resource_name = 'categories'
     allowed_methods = ['get']
     filtering = {
         'identifier': ALL,
     }
     serializer = CountJSONSerializer()
     authorization = ApiLockdownAuthorization()
예제 #3
0
 class Meta:
     queryset = HierarchicalKeyword.objects.all().order_by('name')
     resource_name = 'keywords'
     allowed_methods = ['get']
     filtering = {
         'slug': ALL,
     }
     serializer = CountJSONSerializer()
     authorization = ApiLockdownAuthorization()
예제 #4
0
 class Meta:
     queryset = Group.objects.exclude(groupprofile=None)
     resource_name = 'groups'
     allowed_methods = ['get']
     filtering = {
         'name': ALL,
         'group_profile': ALL_WITH_RELATIONS,
     }
     ordering = ['name', 'last_modified']
     authorization = ApiLockdownAuthorization()
예제 #5
0
 class Meta:
     queryset = Region.objects.all().order_by('name')
     resource_name = 'regions'
     allowed_methods = ['get']
     filtering = {
         'name': ALL,
         'code': ALL,
     }
     if settings.API_INCLUDE_REGIONS_COUNT:
         serializer = CountJSONSerializer()
     authorization = ApiLockdownAuthorization()
예제 #6
0
    class Meta:
        queryset = DataType.objects.all().order_by('gn_description')
        resource_name = 'datatype'
        allowed_methods = ['get']
        excludes = ['is_choice', 'description_en', 'gn_description_en']

        filtering = {
            'identifier': ALL,
        }
        serializer = CountJSONSerializer()
        authorization = ApiLockdownAuthorization()
예제 #7
0
 class Meta:
     queryset = GroupProfile.objects.all()
     resource_name = 'group_profile'
     allowed_methods = ['get']
     filtering = {
         'title': ALL,
         'slug': ALL,
         'categories': ALL_WITH_RELATIONS,
     }
     ordering = ['title', 'last_modified']
     authorization = ApiLockdownAuthorization()
예제 #8
0
 class Meta:
     #print("TESTE NA API EMBRAPATAGRESOURCE3")
     queryset = Embrapa_Keywords.objects.all().order_by('name')
     #print(queryset)
     resource_name = 'embrapa_keywords'
     allowed_methods = ['get']
     filtering = {
         'slug': ALL,
     }
     serializer = CountJSONSerializer()
     authorization = ApiLockdownAuthorization()
예제 #9
0
    class Meta:
        queryset = get_user_model().objects.exclude(username='******')
        resource_name = 'owners'
        allowed_methods = ['get']
        ordering = ['username', 'date_joined']
        excludes = ['is_staff', 'password', 'is_superuser',
                    'is_active', 'last_login']

        filtering = {
            'username': ALL,
        }
        serializer = CountJSONSerializer()
        authorization = ApiLockdownAuthorization()
예제 #10
0
    class Meta:
        queryset = ThesaurusKeyword.objects \
            .all() \
            .order_by('alt_label') \
            .select_related('thesaurus')

        resource_name = 'thesaurus/keywords'
        allowed_methods = ['get']
        filtering = {
            'id': ALL,
            'alt_label': ALL,
            'thesaurus': ALL,
        }
        serializer = CountJSONSerializer()
        authorization = ApiLockdownAuthorization()