Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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