Tastypie filtering with multiple values

后端 未结 5 747
你的背包
你的背包 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:20

    You must declare the filtering columns in class Meta. This is a security by obscurity rule.

    So, the accountId__in=[..] rule is one of these.

    ``` filtering = { 'accountId' : ALL } OR filtering = { 'accountId' : [ ..., 'in' ] }

    ```

提交回复
热议问题