plone.app.collection管理复杂查询的复合标准
collective.compoundcriterion的Python项目详细描述
……图片::https://secure.travis ci.org/collective/collective.compoundcriteria.png
:目标:http://travis ci.org/collective/collective.compoundcriteria
…图片::https://coveralls.io/repos/collective/collective.compoundcriteria/badge.svg?branch=master&service=github
:目标:https://coveralls.io/github/collective/collective.compoundcriteria?branch=master
==collective.compoundcriterion
==br/>==br/>==collective.compoundcriterion
==br/>==br===br==br==br/>
这个包为plone.app.collection添加了一种新的标准。
某些索引由具有特定逻辑的不同元素组成,或者您需要查询站点的特定元素,如当前用户组或其他任何内容。
使用默认索引和集合ui无法实现这一点,您需要编写python代码。
在名为“filter”的“其他”可用索引类别下归档的新条件可用。
选择“filter”时,选择框将显示提供collective.compoundcriterion.interfaces.icoumpondcriterionfilter接口的命名适配器。
这仍然可以与其他条件一起使用。
代码::xml
<;adapter for=“*”
factory=“collective.compoundcriterionfilteradapter.tests.adapter.compoundcriterionfilteradapter”
提供“collective.compoundcriterionfilter.interfaces.icompoundcriterionfilter”
name=“testing compound adapter”/>;
如何测试
----
将上面的适配器注册zcml添加到configure.zcml文件(与collective.compoundcriteria中的文件类似)。它将使集合“filter”索引中的“testing compound adapter”可用。
因此,创建一个具有这样标题的文档,它应该可以工作。
可以使用第二个适配器来测试:
…代码::xml
<;adapter for=“*”
factory=“collective.compoundcriterionfilteradapter.tests.adapter.samplecompoundcriterionfilteradapter”
提供了“collective.compoundcriterionfilter.interfaces.icompoundcriterionfilter”
name=“sample compound adapter”/>;
这一个将查询标题中有“title_with_sample_text”的元素。
尝试在各种情况下获得真实的上下文。这是使用PrOn.App.CordType中的集合
的情况。
[GBASTIEN]
-不要使用StaseWistGET来呈现QueReSnGy小部件,因为它不再为Br.App.CordNoType集合使用
。
使用MuleSeReCultWIDGET。最后,我们可以选择几个
过滤器来构建查询。
[gbastien]
-在zcatalog 3的查询中使用“not”时,查询字典中的“query”级别必须替换为“not”。
[sgeulette]
0.3(2016-12-08)
----
-当查询格式不符合plone.app.querystring时返回清除消息。
[gbastien]
0.2(2015-09-04)
----
-如果查询的格式不符合由命名适配器返回的
与
plone.app.querystring.queryparser.parseformquery返回的不兼容,这样它就可以正确地与collective.eeafaced.collectionwidget一起工作。
[gbastien]
<0.1(2015-06-02)
----
-初始版本。
[综管系统]
:目标:http://travis ci.org/collective/collective.compoundcriteria
…图片::https://coveralls.io/repos/collective/collective.compoundcriteria/badge.svg?branch=master&service=github
:目标:https://coveralls.io/github/collective/collective.compoundcriteria?branch=master
==collective.compoundcriterion
==br/>==br/>==collective.compoundcriterion
==br/>==br===br==br==br/>
这个包为plone.app.collection添加了一种新的标准。
某些索引由具有特定逻辑的不同元素组成,或者您需要查询站点的特定元素,如当前用户组或其他任何内容。
使用默认索引和集合ui无法实现这一点,您需要编写python代码。
在名为“filter”的“其他”可用索引类别下归档的新条件可用。
选择“filter”时,选择框将显示提供collective.compoundcriterion.interfaces.icoumpondcriterionfilter接口的命名适配器。
这仍然可以与其他条件一起使用。
代码::xml
<;adapter for=“*”
factory=“collective.compoundcriterionfilteradapter.tests.adapter.compoundcriterionfilteradapter”
提供“collective.compoundcriterionfilter.interfaces.icompoundcriterionfilter”
name=“testing compound adapter”/>;
如何测试
----
将上面的适配器注册zcml添加到configure.zcml文件(与collective.compoundcriteria中的文件类似)。它将使集合“filter”索引中的“testing compound adapter”可用。
因此,创建一个具有这样标题的文档,它应该可以工作。
可以使用第二个适配器来测试:
…代码::xml
<;adapter for=“*”
factory=“collective.compoundcriterionfilteradapter.tests.adapter.samplecompoundcriterionfilteradapter”
提供了“collective.compoundcriterionfilter.interfaces.icompoundcriterionfilter”
name=“sample compound adapter”/>;
这一个将查询标题中有“title_with_sample_text”的元素。
尝试在各种情况下获得真实的上下文。这是使用PrOn.App.CordType中的集合
的情况。
[GBASTIEN]
-不要使用StaseWistGET来呈现QueReSnGy小部件,因为它不再为Br.App.CordNoType集合使用
。
使用MuleSeReCultWIDGET。最后,我们可以选择几个
过滤器来构建查询。
[gbastien]
-在zcatalog 3的查询中使用“not”时,查询字典中的“query”级别必须替换为“not”。
[sgeulette]
0.3(2016-12-08)
----
-当查询格式不符合plone.app.querystring时返回清除消息。
[gbastien]
0.2(2015-09-04)
----
-如果查询的格式不符合由命名适配器返回的
与
plone.app.querystring.queryparser.parseformquery返回的不兼容,这样它就可以正确地与collective.eeafaced.collectionwidget一起工作。
[gbastien]
<0.1(2015-06-02)
----
-初始版本。
[综管系统]