Tastypie filtering with multiple values

后端 未结 5 748
你的背包
你的背包 2020-12-28 19:02

I had a simple question on filtering in tastypie.

I want to filter with multiple values. For example:

/api/v1/message/?accountId=1,5,12

5条回答
  •  春和景丽
    2020-12-28 19:05

    The most recent version seems to work pretty easily - just use an "__in":

    /api/v1/message/?accountId__in=1,5,12
    

    (I assume you will need an entry in your resources Meta class, filtering = { 'accountId' : ALL })

提交回复
热议问题