[Checkins] SVN: z3c.searcher/trunk/ bugfix, prepare release

Roger Ineichen roger at projekt01.ch
Sun Feb 22 02:53:48 EST 2009


Log message for revision 97004:
  bugfix, prepare release

Changed:
  U   z3c.searcher/trunk/CHANGES.txt
  U   z3c.searcher/trunk/setup.py
  U   z3c.searcher/trunk/src/z3c/searcher/README.txt
  U   z3c.searcher/trunk/src/z3c/searcher/table.py

-=-
Modified: z3c.searcher/trunk/CHANGES.txt
===================================================================
--- z3c.searcher/trunk/CHANGES.txt	2009-02-22 07:22:09 UTC (rev 97003)
+++ z3c.searcher/trunk/CHANGES.txt	2009-02-22 07:53:48 UTC (rev 97004)
@@ -2,11 +2,13 @@
 CHANGES
 =======
 
-0.5.1dev (unreleased)
----------------------
+0.5.1 (2009-02-22)
+------------------
 
-- ...
+- Fix: added missing zope.interface import in z3c.searcher.table and added
+  tests for SearchTable
 
+
 0.5.0 (2009-02-22)
 ------------------
 

Modified: z3c.searcher/trunk/setup.py
===================================================================
--- z3c.searcher/trunk/setup.py	2009-02-22 07:22:09 UTC (rev 97003)
+++ z3c.searcher/trunk/setup.py	2009-02-22 07:53:48 UTC (rev 97004)
@@ -23,7 +23,7 @@
 
 setup (
     name='z3c.searcher',
-    version='0.5.1dev',
+    version='0.5.1',
     author = "Roger Ineichen and the Zope Community",
     author_email = "zope3-dev at zope.org",
     description = "Persistent and session based search form for Zope3",

Modified: z3c.searcher/trunk/src/z3c/searcher/README.txt
===================================================================
--- z3c.searcher/trunk/src/z3c/searcher/README.txt	2009-02-22 07:22:09 UTC (rev 97003)
+++ z3c.searcher/trunk/src/z3c/searcher/README.txt	2009-02-22 07:53:48 UTC (rev 97004)
@@ -496,6 +496,10 @@
   ...      template="search.pt"
   ...      for=".form.SearchForm"
   ...      />
+  ...  <z3c:template
+  ...      template="table.pt"
+  ...      for=".table.SearchTable"
+  ...      />
   ... </configure>
   ... </configure>
   ... """, context=context)
@@ -664,3 +668,71 @@
       </div>
     </div>
   </form>
+
+
+Search Table
+------------
+
+There is also a search table. This search table uses the criterium and filter
+form and allows you to simply create a search page which will list the results
+as table. Let's define a custom search table:
+
+  >>> from z3c.searcher import table
+  >>> class ContentSearchTable(table.SearchTable):
+  ... 
+  ...     filterFactory = ContentSearchFilter
+
+Before we can use the form, our request needs to provide the form UI layer:
+
+  >>> from zope.interface import alsoProvides
+  >>> from z3c.formui.interfaces import IDivFormLayer
+  >>> alsoProvides(request, IDivFormLayer)
+
+That's all you need for write a simple search form. This form uses it's own
+content search filter and of corse the criteria configured for this filter.
+
+  >>> searchTable = ContentSearchTable(object(), request)
+  >>> searchTable.update()
+  >>> print searchTable.render()
+  <form action="http://127.0.0.1" method="post"
+        enctype="multipart/form-data" class="edit-form"
+        name="formTable" id="formTable">
+    <div class="viewspace">
+        <div class="required-info">
+           <span class="required">*</span>
+           &ndash; required
+        </div>
+      <div>
+      <div class="filterForm">
+        <fieldset>
+  <legend>Filter</legend>
+  <div>
+    <label for="filterformnewCriterium">
+      New Criterium
+    </label>
+    <select name="filterformnewCriterium" size="1">
+      <option value="fullText">fullText</option>
+    </select>
+    <input type="submit" id="filterform-buttons-add"
+         name="filterform.buttons.add"
+         class="submit-widget button-field" value="Add" />
+  </div>
+  <div>
+    <input type="submit" id="filterform-buttons-search"
+         name="filterform.buttons.search"
+         class="submit-widget button-field" value="Search" />
+    <input type="submit" id="filterform-buttons-clear"
+         name="filterform.buttons.clear"
+         class="submit-widget button-field" value="Clear" />
+  </div>
+  </fieldset>
+      </div>
+      <div>
+      </div>
+    </div>
+    </div>
+    <div>
+      <div class="buttons">
+      </div>
+    </div>
+  </form>

Modified: z3c.searcher/trunk/src/z3c/searcher/table.py
===================================================================
--- z3c.searcher/trunk/src/z3c/searcher/table.py	2009-02-22 07:22:09 UTC (rev 97003)
+++ z3c.searcher/trunk/src/z3c/searcher/table.py	2009-02-22 07:53:48 UTC (rev 97004)
@@ -16,14 +16,13 @@
 """
 __docformat__ = "reStructuredText"
 
+import zope.interface
+import z3c.formui.form
+import z3c.table.table
+from z3c.form import button
 from z3c.template.template import getPageTemplate
-from z3c.template.template import getLayoutTemplate
-
 from z3c.i18n import MessageFactory as _
 
-import z3c.formui.form
-from z3c.table import table
-from z3c.form import button
 from z3c.searcher import interfaces
 from z3c.searcher import filter
 from z3c.searcher import form
@@ -38,7 +37,7 @@
     return form.supportsCancel
 
 
-class SearchTable(table.Table, z3c.formui.form.Form):
+class SearchTable(z3c.table.table.Table, z3c.formui.form.Form):
     """Search form with result table."""
 
     zope.interface.implements(interfaces.ISearchTable)



More information about the Checkins mailing list