Answer the question
In order to leave comments, you need to log in
Is it possible to tell ModelSerializer not to create data but to update (DRF)?
There is a model:
class MyModel(...):
first_field = models.ForeignKey(...)
second_field = models.ForeignKey(...)
status = models.CharField(max_length=255)
class Meta:
unique_together = ('first_field', 'second_filed', 'status')
class MyModelModelSerializer(serializers.ModelSerializer):
class Meta:
model = MyModel
fields = '__all__'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question