api: Add scan-data-labels API
This commit is contained in:
parent
116c8d30a2
commit
7be9528ca7
@ -1921,3 +1921,19 @@ class ABTestReportView(BaseView):
|
|||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
'ok': True,
|
'ok': True,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
class ScanDataLabelsView(BaseView):
|
||||||
|
name = 'scan-data-labels'
|
||||||
|
auth_check = 'admin'
|
||||||
|
|
||||||
|
def get(self, request):
|
||||||
|
ret = []
|
||||||
|
for x in ScanData.objects.all().order_by('pk').values('id', 'labels', 'image'):
|
||||||
|
ret.append({
|
||||||
|
'id': x['id'],
|
||||||
|
'labels': x.get('labels'),
|
||||||
|
'image': x.get('image'),
|
||||||
|
})
|
||||||
|
return JsonResponse({
|
||||||
|
'items': ret,
|
||||||
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user