This QueryDict instance is immutable

后端 未结 5 1090
夕颜
夕颜 2020-12-30 06:10

I have a Branch model with a foreign key to account (the owner of the branch):

class Branch(SafeDeleteModel):
    _safedelete_policy = SOFT_DELETE_CASCADE
           


        
5条回答
  •  悲&欢浪女
    2020-12-30 06:31

    Do you know any better way to add additional fields when creating an object with django rest framework?

    The official way to provide extra data when creating/updating an object is to pass them to the serializer.save() as shown here

提交回复
热议问题