remove padding when using ContentListing interface (#4610)
This commit is contained in:
parent
e753b90928
commit
5e01f77742
|
@ -27,6 +27,7 @@ from plone.z3cform.layout import wrap_form
|
||||||
import plone.app.querystring.querybuilder
|
import plone.app.querystring.querybuilder
|
||||||
from plone.app.querystring.interfaces import IQuerystringRegistryReader
|
from plone.app.querystring.interfaces import IQuerystringRegistryReader
|
||||||
from plone.registry.interfaces import IRegistry
|
from plone.registry.interfaces import IRegistry
|
||||||
|
+from plone.app.contentlisting.contentlisting import ContentListing
|
||||||
|
|
||||||
from pfwbged.collection import _
|
from pfwbged.collection import _
|
||||||
|
|
||||||
|
@ -389,6 +390,14 @@ class ContentListingView(BrowserView):
|
||||||
|
|
||||||
|
|
||||||
class QueryBuilder(plone.app.querystring.querybuilder.QueryBuilder):
|
class QueryBuilder(plone.app.querystring.querybuilder.QueryBuilder):
|
||||||
|
def _makequery(self, *args, **kwargs):
|
||||||
|
results = plone.app.querystring.querybuilder.QueryBuilder._makequery(self, *args, **kwargs)
|
||||||
|
if isinstance(results, ContentListing):
|
||||||
|
# results may have been padded with None, but ContentListing
|
||||||
|
# doesn't like that.
|
||||||
|
results._basesequence = [x for x in results._basesequence if x is not None]
|
||||||
|
return results
|
||||||
|
|
||||||
def html_results(self, query):
|
def html_results(self, query):
|
||||||
"""html results, used for in the edit screen of a collection,
|
"""html results, used for in the edit screen of a collection,
|
||||||
used in the live update results"""
|
used in the live update results"""
|
||||||
|
|
Reference in New Issue