具有多个值的 Tastypie 过滤 [英] Tastypie filtering with multiple values
本文介绍了具有多个值的 Tastypie 过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的问题,关于在美味派中进行过滤.
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
这不起作用.知道我该怎么做吗?
This doesnt work. Any idea how i can do this?
我需要使用高级过滤吗?如果是,我该如何创建这样的过滤器?一个简单的 puesdo 代码示例会很棒!
Do i need to use advanced filtering? If yes, how do I go about creating such a filter? A simple effortless example of puesdo-code would be great!
谢谢!
推荐答案
嗯,
你可以这样做:
/api/v1/message/?accountId__in=1&accountId__in=5&accountId__in=12
PS:在过滤元属性中,添加{'accountId': ALL}
PS: in filtering meta attribute, add {'accountId': ALL}
这篇关于具有多个值的 Tastypie 过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文