def rdf_catalog_format(format): params = multi_to_dict(request.args) page = int(params.get('page', 1)) page_size = int(params.get('page_size', 100)) datasets = Dataset.objects.visible().paginate(page, page_size) catalog = build_catalog(current_site, datasets, format=format) return graph_response(catalog, format)
def rdf_format(dataset, format): if not DatasetEditPermission(dataset).can(): if dataset.private: abort(404) elif dataset.deleted: abort(410) resource = dataset_to_rdf(dataset) return graph_response(resource, format)
def get(self, format): params = multi_to_dict(request.args) page = int(params.get('page', 1)) page_size = int(params.get('page_size', 100)) datasets = Dataset.objects.visible().paginate(page, page_size) catalog = build_catalog(current_site, datasets, format=format) # bypass flask-restplus make_response, since graph_response # is handling the content negociation directly return make_response(*graph_response(catalog, format))
def rdf_catalog_format(org, format): if org.deleted: abort(410) params = multi_to_dict(request.args) page = int(params.get('page', 1)) page_size = int(params.get('page_size', 100)) datasets = Dataset.objects(organization=org).visible().paginate( page, page_size) catalog = build_org_catalog(org, datasets, format=format) return graph_response(catalog, format)
def get(self, dataset, format): if not DatasetEditPermission(dataset).can(): if dataset.private: api.abort(404) elif dataset.deleted: api.abort(410) resource = dataset_to_rdf(dataset) # bypass flask-restplus make_response, since graph_response # is handling the content negociation directly return make_response(*graph_response(resource, format))
def get(self, org, format): if org.deleted: api.abort(410) params = multi_to_dict(request.args) page = int(params.get('page', 1)) page_size = int(params.get('page_size', 100)) datasets = Dataset.objects(organization=org).visible().paginate(page, page_size) catalog = build_org_catalog(org, datasets, format=format) # bypass flask-restplus make_response, since graph_response # is handling the content negociation directly return make_response(*graph_response(catalog, format))