[Checkins] SVN: z3c.contents/trunk/src/z3c/contents/ Remove
ContentsSearch adapter, this adapter is not needed,
Roger Ineichen
roger at projekt01.ch
Sat Apr 12 18:09:57 EDT 2008
Log message for revision 85291:
Remove ContentsSearch adapter, this adapter is not needed,
a ignoreContext=True flag is all what we need in the form
Changed:
U z3c.contents/trunk/src/z3c/contents/BROWSER.txt
U z3c.contents/trunk/src/z3c/contents/browser.py
U z3c.contents/trunk/src/z3c/contents/configure.zcml
U z3c.contents/trunk/src/z3c/contents/search.py
U z3c.contents/trunk/src/z3c/contents/tests.py
-=-
Modified: z3c.contents/trunk/src/z3c/contents/BROWSER.txt
===================================================================
--- z3c.contents/trunk/src/z3c/contents/BROWSER.txt 2008-04-12 21:35:52 UTC (rev 85290)
+++ z3c.contents/trunk/src/z3c/contents/BROWSER.txt 2008-04-12 22:09:56 UTC (rev 85291)
@@ -5,6 +5,7 @@
The goal of this package is to offer a modular replacement for the default
contents.html page used in Zope3.
+
Initially
=========
Modified: z3c.contents/trunk/src/z3c/contents/browser.py
===================================================================
--- z3c.contents/trunk/src/z3c/contents/browser.py 2008-04-12 21:35:52 UTC (rev 85290)
+++ z3c.contents/trunk/src/z3c/contents/browser.py 2008-04-12 22:09:56 UTC (rev 85291)
@@ -67,6 +67,7 @@
fields = field.Fields(interfaces.IContentsSearch)
prefix = 'search'
table = None
+ ignoreContext = True
@button.buttonAndHandler(_('Search'), name='search')
def handleSearch(self, action):
@@ -105,7 +106,7 @@
template = getPageTemplate()
- # search sub-form
+ # internal search form provided by IValues adapter
searchForm = None
# internal defaults
@@ -150,7 +151,7 @@
renameItemNotFoundMessage = _('Item not found')
def update(self):
- # first setup columns and process the items as selected if any
+ # first setup search values, generate rows, setup headers and columns
super(ContentsPage, self).update()
# second find out if we support paste
self.clipboard = queryPrincipalClipboard(self.request)
Modified: z3c.contents/trunk/src/z3c/contents/configure.zcml
===================================================================
--- z3c.contents/trunk/src/z3c/contents/configure.zcml 2008-04-12 21:35:52 UTC (rev 85290)
+++ z3c.contents/trunk/src/z3c/contents/configure.zcml 2008-04-12 22:09:56 UTC (rev 85291)
@@ -44,10 +44,6 @@
/>
<adapter
- factory="z3c.contents.search.ContentsSearch"
- />
-
- <adapter
factory="z3c.contents.search.SearchForContainer"
/>
Modified: z3c.contents/trunk/src/z3c/contents/search.py
===================================================================
--- z3c.contents/trunk/src/z3c/contents/search.py 2008-04-12 21:35:52 UTC (rev 85290)
+++ z3c.contents/trunk/src/z3c/contents/search.py 2008-04-12 22:09:56 UTC (rev 85291)
@@ -45,24 +45,6 @@
return result
-class ContentsSearch(object):
- """An adapter for container to satisfy search form requirements."""
-
- zope.interface.implements(interfaces.IContentsSearch)
- zope.component.adapts(zope.interface.Interface)
-
- def __init__(self, context):
- self.context = context
-
- @apply
- def searchterm():
- def get(self):
- return u''
- def set(self, value):
- pass
- return property(get, set)
-
-
def _search_helper(id, object, container, id_filters, object_filters, result):
# check id filters if we get a match then return immediately
for id_filter in id_filters:
Modified: z3c.contents/trunk/src/z3c/contents/tests.py
===================================================================
--- z3c.contents/trunk/src/z3c/contents/tests.py 2008-04-12 21:35:52 UTC (rev 85290)
+++ z3c.contents/trunk/src/z3c/contents/tests.py 2008-04-12 22:09:56 UTC (rev 85291)
@@ -78,10 +78,7 @@
# value adapter
zope.component.provideAdapter(z3c.contents.value.SearchableValues)
- # contents search adapter
- zope.component.provideAdapter(z3c.contents.search.ContentsSearch)
-
def tearDown(test):
setup.placefulTearDown()
More information about the Checkins
mailing list