Django Rest Framework: Send full foreign key objects in GET response but accept only foreign ids in POST payload, without two serializers?

前端 未结 0 562
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-03 16:57

Say I\'ve two models:

class Singer((models.Model):
   name = models.CharField(max_length=200)

class Song(models.Model):
   title = models.CharField(max_length=20         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题