def head(self, request): """ Request a list of all DOIs for the requesting datacentre. """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def head(self, request): """ HEAD does the same as GET. """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def head(self, request): """ Request the most recent version of metadata associated with a given DOI. """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def head(self, request): """ Request an URL associated with a given DOI. """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def head(self, request): """ Request list of pairs of media type and URLs associated with a given DOI. """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def get(self, request): """ This request returns a list of all DOIs for the requesting datacentre. There is no guaranteed order. """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def get(self, request): """ This request returns a URL associated with a given DOI, or a list of all DOIs for the requesting datacentre if no DOI is given (there is no guaranteed order). """ url = urljoin(DATACITE_URL, request.get_full_path()) return _get(request.method, url, get_accept_header(request))
def get_queryset(self): """ Get the list of DOIs. """ url = urljoin(DATACITE_URL, "doi") response = _get('GET', url, {}) if response.status_code != 200: raise ExternalError(response.content) dois = [] for line in response: if line != '': dois.append(line.strip().decode('ISO-8859-1')) return dois