Exemple #1
0
def document_detail(request, source, docID):
    """
    Retrieve one particular document.
    """
    try:
        document = Document.objects.get(key=Document._make_key(source, docID))
    except Document.DoesNotExist:
        return Response(status=404)

    serializer = DocumentSerializer(document)
    return Response(serializer.data)
Exemple #2
0
def document_detail(request, source, docID):
    """
    Retrieve one particular document.
    """
    try:
        document = Document.objects.get(key=Document._make_key(source, docID))
    except Document.DoesNotExist:
        return Response(status=404)

    serializer = DocumentSerializer(document)
    return Response(serializer.data)
Exemple #3
0
 def _get_by_source_id(self, source, docID):
     try:
         return Document.objects.get(key=Document._make_key(source, docID))
     except Document.DoesNotExist:
         return None