not sure if this works

This commit is contained in:
jonaswinkler
2020-11-29 23:00:52 +01:00
parent a634d65b10
commit aa0325deb7
2 changed files with 23 additions and 0 deletions

View File

@@ -93,6 +93,10 @@ class DocumentTypeViewSet(ModelViewSet):
ordering_fields = ("name", "matching_algorithm", "match", "document_count")
class BulkEditForm(object):
pass
class DocumentViewSet(RetrieveModelMixin,
UpdateModelMixin,
DestroyModelMixin,
@@ -149,6 +153,13 @@ class DocumentViewSet(RetrieveModelMixin,
else:
return HttpResponseBadRequest(str(form.errors))
@action(methods=['post'], detail=False)
def bulk_edit(self, request, pk=None):
form = BulkEditForm(data=request.POST)
if not form.is_valid():
return HttpResponseBadRequest("")
return Response({'asd': request.POST['content']})
@action(methods=['get'], detail=True)
def metadata(self, request, pk=None):
try: