예제 #1
0
 class Meta:
     queryset = Layer.objects.all()
     list_allowed_methods = ['get']
     resource_name = 'layers'
     fields = [
         'title', 'thumbnail_url', 'abstract', 'typename', 'detail_url',
         "owner"
     ]
     authorization = GeoNodeAuthorization()
     filtering = {'typename': ALL, 'id': ALL, "owner": ALL_WITH_RELATIONS}
예제 #2
0
파일: rest.py 프로젝트: jondoig/cartoview
 class Meta(CommonMetaApi):
     filtering = CommonMetaApi.filtering
     always_return_data = True
     filtering.update({'app': ALL_WITH_RELATIONS, 'featured': ALL})
     queryset = AppInstance.objects.distinct().order_by('-date')
     if settings.RESOURCE_PUBLISHING:
         queryset = queryset.filter(is_published=True)
     resource_name = 'appinstances'
     allowed_methods = ['get', 'post', 'put']
     excludes = ['csw_anytext', 'metadata_xml']
     authorization = GeoNodeAuthorization()
예제 #3
0
 class Meta:
     resource_name = "maplayers"
     queryset = MapLayer.objects.all().distinct()
     filtering = {
         'id': ALL,
         'name': ALL,
         'map': ALL_WITH_RELATIONS
     }
     authorization = GeoNodeAuthorization()
     authentication = MultiAuthentication(
         SessionAuthentication(), GeonodeApiKeyAuthentication())
예제 #4
0
파일: api.py 프로젝트: wfp-ose/wfp-geonode
    class Meta:
        queryset = get_user_model().objects.exclude(username='******')
        resource_name = 'wfp-profiles'
        authorization = GeoNodeAuthorization()
        allowed_methods = ['get']
        ordering = ['username', 'date_joined']
        excludes = ['is_staff', 'password', 'is_superuser',
                    'is_active', 'last_login']

        filtering = {
            'username': ALL,
        }
        serializer = CountJSONSerializer()
예제 #5
0
class CommonMetaApi:
    authorization = GeoNodeAuthorization()
    allowed_methods = ['get']
    filtering = {'title': ALL,
                 'keywords': ALL_WITH_RELATIONS,
                 'regions': ALL_WITH_RELATIONS,
                 'category': ALL_WITH_RELATIONS,
                 'owner': ALL_WITH_RELATIONS,
                 'date': ALL,
                 'is_published': ALL,
                 'featured': ALL,
                 }
    ordering = ['date', 'title', 'popular_count', 'rating']
    max_limit = None
예제 #6
0
 class Meta:
     resource_name = 'all_resources'
     queryset = ResourceBase.objects.distinct()
     fields = ['id', 'title', 'abstract',
               'type', 'featured', 'owner__username','app', 'owner', 'urls', 'thumbnail_url']
     filtering = {
         'id': ALL,
         'title': ALL,
         'abstract': ALL,
         'featured': ALL,
         'owner': ALL_WITH_RELATIONS
     }
     authorization = GeoNodeAuthorization()
     authentication = MultiAuthentication(
         SessionAuthentication(), GeonodeApiKeyAuthentication())
예제 #7
0
파일: api.py 프로젝트: wfp-ose/wfp-geonode
 class Meta:
     queryset = ResourceBase.objects.filter(featured=True).order_by('-date')
     if settings.RESOURCE_PUBLISHING:
         queryset = queryset.filter(is_published=True)
     resource_name = 'wfp-featured-maps'
     authorization = GeoNodeAuthorization()
     allowed_methods = ['get']
     filtering = {'title': ALL,
                  'keywords': ALL_WITH_RELATIONS,
                  'regions': ALL_WITH_RELATIONS,
                  'category': ALL_WITH_RELATIONS,
                  'owner': ALL_WITH_RELATIONS,
                  'date': ALL,
                  }
     ordering = ['date', 'title', 'popular_count']
     max_limit = None
예제 #8
0
 class Meta:
     resource_name = "attributes"
     queryset = Attribute.objects.distinct()
     fields = ['id', 'attribute', 'description',
               'attribute_label', 'attribute_type', 'visible', 'layer']
     filtering = {
         'id': ALL,
         'attribute': ALL,
         'description': ALL,
         'attribute_label': ALL,
         'attribute_type': ALL,
         'visible': ALL,
         'layer': ALL_WITH_RELATIONS
     }
     authorization = GeoNodeAuthorization()
     authentication = MultiAuthentication(
         SessionAuthentication(), GeonodeApiKeyAuthentication())
예제 #9
0
class CommonMetaApi:
    allowed_methods = ['get']
    include_resource_uri = True
    authentication = MixedBasicAuthentication()
    authorization = GeoNodeAuthorization()