在没有PK的情况下删除多对多关系

时间:2014-08-16 21:38:48

标签: django-rest-framework

我在DRF API中有以下模型:

class InstrumentosMusico(models.Model):
    musico = models.ForeignKey(Musico, related_name="instrumentos")
    instrumento = models.ForeignKey(Instrumento)
    novo = models.BooleanField(null=False)
    remover = models.BooleanField(null=False)

    class Meta:
        db_table = "musicos_instrumentos"
        unique_together = ("musico", "instrumento")

    def __unicode__(self):
        return "%d" % (self.instrumento)

如何发送DELETE请求以便删除这样的对象?

0 个答案:

没有答案