Exemple #1
0
    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))
Exemple #2
0
    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))
Exemple #3
0
    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))
Exemple #4
0
    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))
Exemple #5
0
    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))
Exemple #6
0
    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))
Exemple #7
0
    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))
Exemple #8
0
    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))
Exemple #9
0
    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))
Exemple #10
0
    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))
Exemple #11
0
    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))
Exemple #12
0
    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))
Exemple #13
0
    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