annotation_list = Annotation.objects.all()
paginator = Paginator(annotation_list, 5)
page = request.GET.get("page")
annotations = paginator.get_page(page)
annotations = [a.as_dict() for a in annotations]
return JsonResponse({"annotations": annotations})
After Change
// Left outer join data and annotation.
// Filter manual=False
// Sort prob
docs = Annotation.objects.all()
else:
// Left outer join data and annotation.
docs = RawData.objects.filter(annotation__isnull=True)
docs = [{**d.as_dict(), **{"labels": []}} for d in docs]