-
Notifications
You must be signed in to change notification settings - Fork 108
Description
python 3.7.3
django 2.2.3
djangorestframework 3.9.4
djangorestframework-bulk 0.2.1
class Milestone(models.Model): project = models.ForeignKey(Project, on_delete=models.CASCADE) position = models.IntegerField(default=0) name = models.CharField(max_length=100, default='')
class MilestoneSerializer(BulkSerializerMixin, serializers.ModelSerializer): class Meta: model = Milestone fields = ['id','project', 'position', 'name',] list_serializer_class = BulkListSerializer
class MilestoneViewSet(BulkModelViewSet): queryset = Milestone.objects.all() serializer_class = MilestoneSerializer
work when posting one object:
data={'project':4,'position':21,'name':'test'}
but it does not work posting two objects:
data=[{'project':4,'position':21,'name':'test'},{'project':4,'position':22,'name':'test'}]
Can someone explain if it is a bug or I miss something ?