Skip to content

POST 400 (Bad Request)Β #75

@sfornengo

Description

@sfornengo

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions