Plone更新收集筛选器

Plone更新收集筛选器,plone,plone-4.x,Plone,Plone 4.x,我可以从Plone集合(Plone.app.Collection)更新筛选器吗 我收集了一套软管过滤器: portal_type = Project review_state = published 使用BrowserView(表单),我想扩展此过滤器,如下所示: portal_type = Project review_state = published + subject = ['test', 'foo'] 如何实现这一点?由于最近对plone.app.collection进行了

我可以从Plone集合(Plone.app.Collection)更新筛选器吗

我收集了一套软管过滤器:

portal_type = Project
review_state = published
使用BrowserView(表单),我想扩展此过滤器,如下所示:

portal_type = Project  
review_state = published
+  
subject = ['test', 'foo']

如何实现这一点?

由于最近对plone.app.collection进行了更改(请确保使用plone.app.collection 1.1.2或更高版本),这非常简单

将集合作为
collection
加载到代码中(或者如果正在对集合本身运行视图,则可能是
context
),如果调用…:

results = collection.results()
results
将包含集合本身找到的所有内容,因此您可以使用
review\u state
portal\u type
应用过滤器

但您可以按如下方式使用
自定义_查询
参数:

results = collection.results(custom_query={'Subject': ['test', 'foo']})

请稍微澄清一下这个问题:您已经在Plone集合界面中配置了portal_type和review_state筛选器,并且希望以编程方式扩展应用的筛选器?是的,集合显示所有已发布的项目,并且在一个表单中,用户可以添加更多筛选器标准,发送后,我想用用户设置的参数扩展原始过滤器