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)
def _get_by_source_id(self, source, docID): try: return Document.objects.get(key=Document._make_key(source, docID)) except Document.DoesNotExist: return None