Forráskód Böngészése

Merge commit '9e300b88cd5430cc804d147a2c8f3bf49dea5fdb' into cookiecutter

Conflicts:
	README.rst
	rest_framework_bulk/generics.py
Miroslav Shubernetskiy 10 éve
szülő
commit
7e663526e8
2 módosított fájl, 16 hozzáadás és 0 törlés
  1. 1 0
      AUTHORS.rst
  2. 15 0
      rest_framework_bulk/generics.py

+ 1 - 0
AUTHORS.rst

@@ -10,6 +10,7 @@ Contributors
 ~~~~~~~~~~~~
 
 * Arien Tolner - https://github.com/Bounder
+* Davide Mendolia - https://github.com/davideme
 * Kevin Brown - https://github.com/kevin-brown
 * Martin Cavoj - https://github.com/macav
 * Mjumbe Poe - https://github.com/mjumbewu

+ 15 - 0
rest_framework_bulk/generics.py

@@ -12,6 +12,7 @@ __all__ = [
     'BulkModelViewSet',
     'BulkUpdateAPIView',
     'ListBulkCreateAPIView',
+    'ListBulkCreateDestroyAPIView',
     'ListBulkCreateUpdateAPIView',
     'ListBulkCreateUpdateDestroyAPIView',
     'ListCreateBulkUpdateAPIView',
@@ -110,6 +111,20 @@ class ListBulkCreateUpdateAPIView(mixins.ListModelMixin,
         return self.partial_bulk_update(request, *args, **kwargs)
 
 
+class ListBulkCreateDestroyAPIView(mixins.ListModelMixin,
+                                   bulk_mixins.BulkCreateModelMixin,
+                                   bulk_mixins.BulkDestroyModelMixin,
+                                   GenericAPIView):
+    def get(self, request, *args, **kwargs):
+        return self.list(request, *args, **kwargs)
+
+    def post(self, request, *args, **kwargs):
+        return self.create(request, *args, **kwargs)
+
+    def delete(self, request, *args, **kwargs):
+        return self.bulk_destroy(request, *args, **kwargs)
+
+
 class ListBulkCreateUpdateDestroyAPIView(mixins.ListModelMixin,
                                          bulk_mixins.BulkCreateModelMixin,
                                          bulk_mixins.BulkUpdateModelMixin,