Django rest framework - filter many-to-many field

后端 未结 2 986
孤街浪徒
孤街浪徒 2021-01-18 23:02

Suppose I have a model like this one:

class Car(models.Model):
    images = models.ManyToManyField(Image)

class Image(models.Model):
    path = models.CharF         


        
2条回答
  •  不要未来只要你来
    2021-01-18 23:15

    I have found a other Stackoverflow question that has a solution that could be used here:

    How can I apply a filter to a nested resource in Django REST framework?

    (see under the "Solution" headline in the question itself)

提交回复
热议问题