views.py 414 B

123456789101112131415
  1. from __future__ import unicode_literals, print_function
  2. from rest_framework_bulk import generics
  3. from . import models
  4. class SimpleBulkAPIView(generics.ListBulkCreateUpdateDestroyAPIView):
  5. model = models.SimpleModel
  6. class FilteredBulkAPIView(generics.ListBulkCreateUpdateDestroyAPIView):
  7. model = models.SimpleModel
  8. def filter_queryset(self, queryset):
  9. return queryset.filter(number__gt=5)