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}
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()
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())
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()
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
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())
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
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())
class CommonMetaApi: allowed_methods = ['get'] include_resource_uri = True authentication = MixedBasicAuthentication() authorization = GeoNodeAuthorization()