[Testbot] Plone 4.3 - Python 2.7 - Build # 2445 - Still failing! - 4 failure(s)
jenkins at plone.org
jenkins at plone.org
Sun Aug 17 20:07:47 UTC 2014
-------------------------------------------------------------------------------
Plone 4.3 - Python 2.7 - Build # 2445 - Still Failing!
-------------------------------------------------------------------------------
http://jenkins.plone.org/job/plone-4.3-python-2.7/2445/
-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-07-23T18:05:54+02:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/9d890d143c2e0a39dc95012a5c40290b97f0ad0e
upport custom_query parameter in the result method of the Collection behavior. This allows for run time customization of the stored query, e.g. by request parameters.
Files changed:
M docs/CHANGES.rst
M plone/app/contenttypes/behaviors/collection.py
M plone/app/contenttypes/tests/test_collection.py
M setup.py
diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index 600d425..9eebd1d 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -4,6 +4,11 @@ Changelog
1.2a4 (unreleased)
------------------
+- Support ``custom_query`` parameter in the ``result`` method of the
+ ``Collection`` behavior. This allows for run time customization of the
+ stored query, e.g. by request parameters.
+ [thet]
+
- Replace AT-fti with DX-fti when migrating a type.
[esteele, pbauer]
diff --git a/plone/app/contenttypes/behaviors/collection.py b/plone/app/contenttypes/behaviors/collection.py
index 906096d..59f9edb 100644
--- a/plone/app/contenttypes/behaviors/collection.py
+++ b/plone/app/contenttypes/behaviors/collection.py
@@ -98,7 +98,8 @@ def __init__(self, context):
self.context = context
def results(self, batch=True, b_start=0, b_size=None,
- sort_on=None, limit=None, brains=False):
+ sort_on=None, limit=None, brains=False,
+ custom_query={}):
querybuilder = getMultiAdapter((self.context, self.context.REQUEST),
name='querybuilderresults')
sort_order = 'reverse' if self.sort_reversed else 'ascending'
@@ -138,7 +139,7 @@ def results(self, batch=True, b_start=0, b_size=None,
return querybuilder(
query=query, batch=batch, b_start=b_start, b_size=b_size,
sort_on=sort_on, sort_order=sort_order,
- limit=limit, brains=brains
+ limit=limit, brains=brains, custom_query=custom_query
)
def getFoldersAndImages(self):
diff --git a/plone/app/contenttypes/tests/test_collection.py b/plone/app/contenttypes/tests/test_collection.py
index 0dd3554..3efdf42 100644
--- a/plone/app/contenttypes/tests/test_collection.py
+++ b/plone/app/contenttypes/tests/test_collection.py
@@ -313,6 +313,51 @@ def test_sorting_1(self):
self.assertTrue(ritem0.CreationDate() > ritem1.CreationDate())
self.assertTrue(ritem1.CreationDate() > ritem2.CreationDate())
+ def test_custom_query(self):
+ portal = self.layer['portal']
+ login(portal, 'admin')
+ query = [{
+ 'i': 'portal_type',
+ 'o': 'plone.app.querystring.operation.string.is',
+ 'v': ['News Item', 'Document'],
+ }]
+ portal.invokeFactory("Collection",
+ "collection",
+ title="New Collection",
+ query=query,
+ )
+
+ # item 1
+ portal.invokeFactory(id='testnews',
+ type_name='News Item')
+ item1 = portal.testnews
+ item1.reindexObject()
+
+ # item 2
+ portal.invokeFactory(id="testdoc",
+ type_name='Document')
+ item2 = portal.testdoc
+ item2.reindexObject()
+
+ collection = portal['collection']
+ wrapped = ICollection_behavior(collection)
+
+ # Test unmodified query
+ results = wrapped.results(batch=False)
+ self.assertEqual(len(results), 2)
+
+ # Test with custom query
+ results = wrapped.results(batch=False,
+ custom_query={'portal_type': 'Document'})
+ self.assertEqual(len(results), 1)
+ self.assertEqual(results[0].id, 'testdoc')
+
+ # Test with custom query, which should not find anything
+ results = wrapped.results(batch=False,
+ custom_query={'portal_type': 'Document',
+ 'id': 'bla'})
+ self.assertEqual(len(results), 0)
+
def test_getFoldersAndImages(self):
portal = self.layer['portal']
login(portal, 'admin')
diff --git a/setup.py b/setup.py
index 0200426..2f6de37 100644
--- a/setup.py
+++ b/setup.py
@@ -41,6 +41,7 @@ def read(*rnames):
'plone.app.contentmenu',
'plone.app.event >= 2.0a1',
'plone.app.dexterity >= 2.0.7', # has a fix for INameFromFilename
+ 'plone.app.querystring >= 1.2.2.dev0',
'plone.dexterity >= 2.2.1', # behaviors can provide primaryfields
'plone.app.relationfield',
'plone.namedfile [blobs]',
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-07-23T18:11:12+02:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/abdf073a18434f0ca9e122b84cae56c5ee61334a
add comment describing the need for this version dep
Files changed:
M setup.py
diff --git a/setup.py b/setup.py
index 2f6de37..d47b2ad 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ def read(*rnames):
'plone.app.contentmenu',
'plone.app.event >= 2.0a1',
'plone.app.dexterity >= 2.0.7', # has a fix for INameFromFilename
- 'plone.app.querystring >= 1.2.2.dev0',
+ 'plone.app.querystring >= 1.2.2.dev0', # custom_query support
'plone.dexterity >= 2.2.1', # behaviors can provide primaryfields
'plone.app.relationfield',
'plone.namedfile [blobs]',
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-08-07T06:28:48+02:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/b0ffbe28458fafc8526fc5ca6a9ba256d107840c
plone.app.querystring has a release
Files changed:
M setup.py
diff --git a/setup.py b/setup.py
index d47b2ad..62252bb 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ def read(*rnames):
'plone.app.contentmenu',
'plone.app.event >= 2.0a1',
'plone.app.dexterity >= 2.0.7', # has a fix for INameFromFilename
- 'plone.app.querystring >= 1.2.2.dev0', # custom_query support
+ 'plone.app.querystring >= 1.2.2', # custom_query support
'plone.dexterity >= 2.2.1', # behaviors can provide primaryfields
'plone.app.relationfield',
'plone.namedfile [blobs]',
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-08-07T06:31:45+02:00
Author: Johannes Raggam (thet) <raggam-nl at adm.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/b68fbc9e615206f13b1558180d5a75d492510872
merge with master
Files changed:
M docs/CHANGES.rst
M setup.py
diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index 9eebd1d..1931604 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -9,6 +9,11 @@ Changelog
stored query, e.g. by request parameters.
[thet]
+- Restore Plone 4.3 compatibility by depending on ``plone.app.event >= 2.0a4``.
+ The previous release of p.a.c got an implicit Plone 5 dependency through a
+ previous version of plone.app.event.
+ [thet]
+
- Replace AT-fti with DX-fti when migrating a type.
[esteele, pbauer]
diff --git a/setup.py b/setup.py
index 62252bb..133b415 100644
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,7 @@ def read(*rnames):
'setuptools',
'Products.CMFPlone',
'plone.app.contentmenu',
- 'plone.app.event >= 2.0a1',
+ 'plone.app.event >= 2.0a4',
'plone.app.dexterity >= 2.0.7', # has a fix for INameFromFilename
'plone.app.querystring >= 1.2.2', # custom_query support
'plone.dexterity >= 2.2.1', # behaviors can provide primaryfields
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-08-17T21:32:47+02:00
Author: Philip Bauer (pbauer) <bauer at starzel.de>
Commit: https://github.com/plone/plone.app.contenttypes/commit/12f4cf306ab073ed775bcba0cddcf3abbf6d866c
Merge branch 'master' into thet-custom_query
Conflicts:
docs/CHANGES.rst
Files changed:
M docs/CHANGES.rst
M plone/app/contenttypes/browser/templates/newsitem.pt
diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index 1931604..d6c4a63 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -9,6 +9,9 @@ Changelog
stored query, e.g. by request parameters.
[thet]
+- Fix 'AttributeError: image' when NewsItem unused the lead image behavior.
+ [jianaijun]
+
- Restore Plone 4.3 compatibility by depending on ``plone.app.event >= 2.0a4``.
The previous release of p.a.c got an implicit Plone 5 dependency through a
previous version of plone.app.event.
diff --git a/plone/app/contenttypes/browser/templates/newsitem.pt b/plone/app/contenttypes/browser/templates/newsitem.pt
index 20efd6b..93d034a 100644
--- a/plone/app/contenttypes/browser/templates/newsitem.pt
+++ b/plone/app/contenttypes/browser/templates/newsitem.pt
@@ -19,7 +19,7 @@
<metal:block define-macro="content-core"
tal:define="templateId template/getId;
scale_func context/@@images;
- scaled_image python: context.image and scale_func.scale('image', scale='mini')">
+ scaled_image python: hasattr(context.aq_explicit, 'image') and scale_func.scale('image', scale='mini')">
<div class="newsImageContainer"
tal:condition="python: scaled_image">
@@ -43,7 +43,7 @@
tal:content="structure context/text/output" />
<div class="newsFileContainer"
- tal:condition="python: context.image and not scaled_image">
+ tal:condition="python: hasattr(context.aq_explicit, 'image') and not scaled_image">
<a tal:content="structure python:context.image_caption or context.image.filename"
tal:attributes="href python:'%s/@@download/image' % context.absolute_url()">
</a>
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-08-17T21:33:00+02:00
Author: Philip Bauer (pbauer) <bauer at starzel.de>
Commit: https://github.com/plone/plone.app.contenttypes/commit/07aae0dfd85cd6f74459b5e9115fcc200bd438a8
Merge branch 'thet-custom_query'
Files changed:
M docs/CHANGES.rst
M plone/app/contenttypes/behaviors/collection.py
M plone/app/contenttypes/tests/test_collection.py
M setup.py
diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index c363eb2..d6c4a63 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -4,6 +4,11 @@ Changelog
1.2a4 (unreleased)
------------------
+- Support ``custom_query`` parameter in the ``result`` method of the
+ ``Collection`` behavior. This allows for run time customization of the
+ stored query, e.g. by request parameters.
+ [thet]
+
- Fix 'AttributeError: image' when NewsItem unused the lead image behavior.
[jianaijun]
diff --git a/plone/app/contenttypes/behaviors/collection.py b/plone/app/contenttypes/behaviors/collection.py
index 906096d..59f9edb 100644
--- a/plone/app/contenttypes/behaviors/collection.py
+++ b/plone/app/contenttypes/behaviors/collection.py
@@ -98,7 +98,8 @@ def __init__(self, context):
self.context = context
def results(self, batch=True, b_start=0, b_size=None,
- sort_on=None, limit=None, brains=False):
+ sort_on=None, limit=None, brains=False,
+ custom_query={}):
querybuilder = getMultiAdapter((self.context, self.context.REQUEST),
name='querybuilderresults')
sort_order = 'reverse' if self.sort_reversed else 'ascending'
@@ -138,7 +139,7 @@ def results(self, batch=True, b_start=0, b_size=None,
return querybuilder(
query=query, batch=batch, b_start=b_start, b_size=b_size,
sort_on=sort_on, sort_order=sort_order,
- limit=limit, brains=brains
+ limit=limit, brains=brains, custom_query=custom_query
)
def getFoldersAndImages(self):
diff --git a/plone/app/contenttypes/tests/test_collection.py b/plone/app/contenttypes/tests/test_collection.py
index 0dd3554..3efdf42 100644
--- a/plone/app/contenttypes/tests/test_collection.py
+++ b/plone/app/contenttypes/tests/test_collection.py
@@ -313,6 +313,51 @@ def test_sorting_1(self):
self.assertTrue(ritem0.CreationDate() > ritem1.CreationDate())
self.assertTrue(ritem1.CreationDate() > ritem2.CreationDate())
+ def test_custom_query(self):
+ portal = self.layer['portal']
+ login(portal, 'admin')
+ query = [{
+ 'i': 'portal_type',
+ 'o': 'plone.app.querystring.operation.string.is',
+ 'v': ['News Item', 'Document'],
+ }]
+ portal.invokeFactory("Collection",
+ "collection",
+ title="New Collection",
+ query=query,
+ )
+
+ # item 1
+ portal.invokeFactory(id='testnews',
+ type_name='News Item')
+ item1 = portal.testnews
+ item1.reindexObject()
+
+ # item 2
+ portal.invokeFactory(id="testdoc",
+ type_name='Document')
+ item2 = portal.testdoc
+ item2.reindexObject()
+
+ collection = portal['collection']
+ wrapped = ICollection_behavior(collection)
+
+ # Test unmodified query
+ results = wrapped.results(batch=False)
+ self.assertEqual(len(results), 2)
+
+ # Test with custom query
+ results = wrapped.results(batch=False,
+ custom_query={'portal_type': 'Document'})
+ self.assertEqual(len(results), 1)
+ self.assertEqual(results[0].id, 'testdoc')
+
+ # Test with custom query, which should not find anything
+ results = wrapped.results(batch=False,
+ custom_query={'portal_type': 'Document',
+ 'id': 'bla'})
+ self.assertEqual(len(results), 0)
+
def test_getFoldersAndImages(self):
portal = self.layer['portal']
login(portal, 'admin')
diff --git a/setup.py b/setup.py
index e7d9d45..133b415 100644
--- a/setup.py
+++ b/setup.py
@@ -41,6 +41,7 @@ def read(*rnames):
'plone.app.contentmenu',
'plone.app.event >= 2.0a4',
'plone.app.dexterity >= 2.0.7', # has a fix for INameFromFilename
+ 'plone.app.querystring >= 1.2.2', # custom_query support
'plone.dexterity >= 2.2.1', # behaviors can provide primaryfields
'plone.app.relationfield',
'plone.namedfile [blobs]',
-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 14894 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140817/718bc8c6/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 93575 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140817/718bc8c6/attachment-0003.obj>
More information about the Testbot
mailing list