具有多个值Tastypie过滤 [英] Tastypie filtering with multiple values
本文介绍了具有多个值Tastypie过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的问题上tastypie过滤。
I had a simple question on filtering in tastypie.
我要与多个值进行过滤。例如:
I want to filter with multiple values. For example:
/ API / V1 /消息/?帐户ID = 1,5,12
这不工作。任何想法我怎么可以这样做呢?
This doesnt work. Any idea how i can do this?
我是否需要使用高级过滤?如果是的话,我怎么去建立这样一个过滤器? puesdo- code的一个简单的例子毫不费力的将是巨大的!
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 /消息/ accountId__in = 1&安培; accountId__in = 5和accountId__in = 12
PS:在过滤元属性,添加 {'帐户ID:ALL}
PS: in filtering meta attribute, add {'accountId': ALL}
这篇关于具有多个值Tastypie过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文